bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/22750] .sizeof. directive is handled incorrectly in shared objec


From: amodra at gmail dot com
Subject: [Bug ld/22750] .sizeof. directive is handled incorrectly in shared object
Date: Mon, 29 Jan 2018 01:37:28 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=22750

--- Comment #2 from Alan Modra <amodra at gmail dot com> ---
> .sizeof. (__verbose) in shared object gets the size of __verbose
> in executable.

No, that isn't true.  The value is the size of __verbose in the shared library
plus the base of the shared library.

> Relocation against .sizeof.__verbose is very special.  It is handled
> incorrectly in shared object.

Yes, and this is a general bug in the way absolute symbols are handled.  They
shouldn't be relocated at runtime but we do that for historical reasons. 
Symbols like __GLOBAL_OFFSET_TABLE__ used to be made SHN_ABS but they are
obviously relative to the base of the shared library.  Similarly, user defined
symbols in linker scripts might be absolute but the user really want them to be
relative to the base of the shared library.  We could fix the way absolute
symbols behave at the risk of breaking (possibly a lot) of user code.

32253bb79 is a separate issue.  I wrongly put "wanted the size of" when I meant
"wanted the symbols for" in the log.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]