You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following linker script causes unexpected behaviour when APPLE is not defined by any input objects. The unexpected output is that APPLE will resolve to '1' instead of '2'.
APPLE = DEFINED (APPLE) ? 1 : 2;
It appears that when the symbol is first processed it is added to the symbol table with the expected value, however LLD reevaluates symbol assignments, and during these subsequent evaluations of the expression the DEFINED now returns 1 as APPLE has been inserted in the symbol table.
The text was updated successfully, but these errors were encountered:
Fixllvm#64600: the currently implementation is minimal (see
https://reviews.llvm.org/D83758), and an assignment like
`__TEXT_REGION_ORIGIN__ = DEFINED(__TEXT_REGION_ORIGIN__) ? __TEXT_REGION_ORIGIN__ : 0;`
(used by avr-ld[1]) leads to a value of zero (default value in `declareSymbol`),
which is unexpected.
Assign orders to symbol assignments and references so that
for a script-defined symbol, the `DEFINED` results match users'
expectation. I am unclear about GNU ld's exact behavior, but this hopefully
matches its behavior in the majority of cases.
[1]: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/scripttempl/avr.sc
The following linker script causes unexpected behaviour when
APPLE
is not defined by any input objects. The unexpected output is thatAPPLE
will resolve to '1' instead of '2'.It appears that when the symbol is first processed it is added to the symbol table with the expected value, however LLD reevaluates symbol assignments, and during these subsequent evaluations of the expression the
DEFINED
now returns 1 asAPPLE
has been inserted in the symbol table.The text was updated successfully, but these errors were encountered: