[Bug] DWARF-5 section names in PE/PEP and weak symbols

Achim Gratz Stromeko@nexgo.de
Tue Feb 15 20:19:08 GMT 2022


Achim Gratz writes:
> So, snprintf seems to behave as expected (it resolves NULL) and the two
> other symbols are resolved even though they should not.  If they had
> resolved to the actual address things might even work, but the actual
> values explain nicely why a program calling through the pointer crashes
> in various horrible ways (depending on what actually is mapped there).

I've verified that when I add potential call sites and not just printf
output to the other two functions, they no longer get resolved at link
time and show up as NULL in the resulting executable.  That part is
quite likely as intended.  However, if the linker doesn't see a call site
it resolves something that apparently doesn't work later on.  I have not
yet tracked down how the grep-3.7 binary ends up crashing, but the most
likely path is that theweak symbol gets resolved to something
nonsensical during an intermediate link step and then transferred into
the actual executable that doesn't resolve the symbol at all (using some
data in the object instead of the library) or not relocating correctly.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada


More information about the Binutils mailing list