Summary: | sys-devel/binutils: sys-libs/db linking with --as-needed causes segmentation fault in check_match (sym=0x10270) at dl-lookup.c:177 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jeroen Roovers (RETIRED) <jer> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hppa, zerochaos |
Priority: | Normal | Keywords: | Inclusion, PATCH |
Version: | unspecified | ||
Hardware: | HPPA | ||
OS: | Linux | ||
URL: | https://sourceware.org/bugzilla/show_bug.cgi?id=16082 | ||
See Also: | https://sourceware.org/bugzilla/show_bug.cgi?id=16082 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
config.log
successful config log from my amd64 box Cleanup version info from hidden symbols forced locals. Cleanup version info from hidden symbols forced locals Cleanup version info from hidden symbols forced locals Cleanup version info from hidden symbols forced locals |
Description
Jeroen Roovers (RETIRED)
2013-04-23 20:35:59 UTC
dev-vcs/subversion performs the same test with the same result. Created attachment 357108 [details]
successful config log from my amd64 box
I'm unable to replicate this issue with either package using amd64, x86, or arm. I'm marking this hppa specific It looks like something might have gone wrong with the /usr/lib/libdb.{a,so} symlinks after some upgrades/downgrades. -rw-r--r-- 1 root root 2082514 Apr 23 21:43 /usr/lib/libdb-4.7.a -rw-r--r-- 1 root root 923 Apr 23 21:24 /usr/lib/libdb-4.7.la -rwxr-xr-x 1 root root 1507876 Apr 23 21:44 /usr/lib/libdb-4.7.so -rwxr-xr-x 1 root root 1541496 Apr 11 15:15 /usr/lib/libdb-4.8.so lrwxrwxrwx 1 root root 11 Aug 28 14:59 /usr/lib/libdb.a -> libdb-4.7.a lrwxrwxrwx 1 root root 12 Aug 28 14:59 /usr/lib/libdb.so -> libdb-4.8.so Also: lrwxrwxrwx 1 root root 10 Aug 28 14:59 /usr/include/db.h -> db4.7/db.h That looks like a likely cause paired with lrwxrwxrwx 1 root root 12 Aug 28 14:59 /usr/lib/libdb.so -> libdb-4.8.so Is this something that might have been recently fixed in db.eclass? # cat libdb.c #include <db.h> int main() { return 0; } # make test gcc -Wl,--as-needed -ggdb -O libdb.c -o libdb -ldb ./libdb make: *** [test] Segmentation fault (core dumped) gdb> t a a bt full Id Target Id Frame * 1 LWP 16719 0x403a9ee8 in check_match (sym=0x10270) at dl-lookup.c:177 # scanelf -n libdb TYPE NEEDED FILE ET_EXEC libdb-4.7.so,libc.so.6 libdb With -Wl,--no-as-needed it runs with no problems. Created attachment 361696 [details, diff]
Cleanup version info from hidden symbols forced locals.
It appears that the function elf32_hppa_hide_symbol() doesn't remove potiential version information when forcing a symbol to be local.
When linking with libdb.so, the library's _GLOBAL_OFFSET_TABLE_ symbol is read first. When it's overwritten later on in _bfd_elf_create_got_section(), the version information is kept while it shouldn't.
I'll get this upstream after a bit of testing.
Created attachment 361712 [details, diff]
Cleanup version info from hidden symbols forced locals
Add a patch that actually builds :)
Created attachment 361714 [details, diff]
Cleanup version info from hidden symbols forced locals
Created attachment 361778 [details, diff]
Cleanup version info from hidden symbols forced locals
Here is the final patch without regression :)
That works. The patch is upstream now. Toolchain, ping ? Can this patch be included in the patch set for 2.23 and 2.24 ? Thanks i've added the fix to binutils-2.24-r3 http://sources.gentoo.org/gentoo/src/patchsets/binutils/2.24/53_all_hppa-as-needed.patch?rev=1.1 |