bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/24524] -Bsymbolic shared libraries broken on x86


From: amodra at gmail dot com
Subject: [Bug gas/24524] -Bsymbolic shared libraries broken on x86
Date: Wed, 05 Jun 2019 23:30:35 +0000

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |INVALID
            Summary|internal error in symbolS   |-Bsymbolic shared libraries
                   |*section_symbol(segT) at    |broken on x86
                   |... gas/subsegs.c:216       |

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
I wasn't thinking when I looked at this PR.  You must be building with
--enable-shared for -Bsymbolic to make any difference.  Adding that configure
option and -Wl,-Bsymbolic to CFLAGS does reproduce the problem and it's an
obvious one.

Using -Bsymbolic changes the behaviour of ELF shared libraries.  In particular,
it breaks x86 and other targets that need to use copy relocations for access to
shared library variables in non-PIC executables.  You end up with duplicates of
the variable, one in the executable and one in the shared library.  When
library code makes changes to the variable after startup, it makes change to
its local copy resulting in the executable copy becoming stale.

Don't use -Bsymbolic unless you know what you're doing.

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