http://sourceware.org/bugzilla/show_bug.cgi?id=13600

--- Comment #6 from Alan Modra <amodra at gmail dot com> 2012-01-19 10:00:36 
UTC ---
In comment #2 I was forgetting what we do in an executable.  In the main
executable (which might be non-PIC), if we take the address of foo and the
address of foo is written into a read-only section (.text or .rodata or
somesuch) then we have a problem.  You've got three choices:
a) either the address location needs a dynamic relocation which results in that
page of the executable being non-shared, or
b) we need the hack of making the address of foo be the plt code for foo in the
executable, with all the pain in ld.so that causes, or
c) you ensure that function addresses never appear in read-only sections.

At the moment we do (b), so I was wrong to say this was a ld bug unless it's
true that x86_64 gcc already does (c).

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

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to