[LLVMbugs] [Bug 3750] FreeBSD's ld-elf.so miscompiles when array is marked as static

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Mar 7 17:33:34 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3750


Chris Lattner <clattner at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #13 from Chris Lattner <clattner at apple.com>  2009-03-07 19:33:32 ---
This is not a compiler bug.  The code also fails at -O0 if the exports array is
manually marked const.  The reason for this that marking it const drops it into
a readonly section, which gets put after the text section.   Because the global
contains pointers to other globals in it, it gets relocation entries for them.

Apparently the code in rtld.c cannot handle text relocations in RTLD itself,
which is the assertion that fires.  Using attribute(used) is a good workaround,
but explicitly putting an attribute(section) on it to pin it to the data
section might be even better.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list