Closed
Description
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.