bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/22592] dyn_reloc count error for sparc PIE


From: jrtc27 at jrtc27 dot com
Subject: [Bug ld/22592] dyn_reloc count error for sparc PIE
Date: Thu, 14 Dec 2017 09:44:14 +0000

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

--- Comment #4 from James Clarke <jrtc27 at jrtc27 dot com> ---
(In reply to James Clarke from comment #3)
> Created attachment 10684 [details]
> Proposed patch
> 
> I debugged this a few months ago as we were occasionally seeing it in Debian
> but never sent this upstream. The problem is because allocate_dynrelocs
> doesn't allocate enough GOT slots for PIC code, which is fixed by the second
> hunk of this patch. The other two hunks are cleanups which add other edge
> cases handled by other architectures but not SPARC.

The only problem I've seen with this patch is that it now over-allocates
relocations for the GOT. gdop_relative_offset_ok is only used after the GOT has
been allocated, so any slots which are for objects "near" the GOT will be
unused and end up as R_SPARC_NONE's padding the end of the GOT. For sparc32 we
could add extra checks in allocate_dynrelocs to precisely determine whether
gdop_relative_offset_ok will return TRUE for that symbol (as the entire address
space is reachable with a 32-bit offset from the GOT), but for sparc64 we can't
in general know if a symbol will be reachable or not that early.

-- 
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]