Summary: | binutils: strip --strip-unneeded strips needed parts of fpc object files | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Harald van Dijk (RETIRED) <truedfx> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | uberlord |
Priority: | High | ||
Version: | 2006.1 | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://sourceware.org/bugzilla/show_bug.cgi?id=9933 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 183604 |
Description
Harald van Dijk (RETIRED)
2007-06-30 12:00:15 UTC
And binutils 2.16.1-r3 behaves the same way as 2.17. this can also be seen with yasm/nasm when the ELF objects dont include DWARF debugging information ... this has been fixed upstream ... i guess i'll put out a 2.17-r1 as who knows when 2.18 will be done *** Bug 186695 has been marked as a duplicate of this bug. *** This was never or only briefly fixed properly. When RESTRICT=strip is removed from fpc/lazarus, bug #183604 happens still. the original test case works fine for me (look at upstream URL) so if that passes for you as well, then you'll have to refresh how to reproduce. it's been way too long for me to remember. no idea what provides "syscall.o" ... Ouch, sorry, it's actually a somewhat different case also triggered in fpc where stripping is also too aggressive. I never noticed the difference before, or I would've let you know about this sooner... Here's the C equivalent: $ cat test1.c int i; $ cat test2.c extern int i; int main(void) { return i; } $ gcc -c test1.c test2.c $ nm test1.o test2.o test1.o: 00000004 C i test2.o: U i 00000000 T main $ strip --strip-unneeded test1.o test2.o $ nm test1.o test2.o test1.o: nm: test1.o: no symbols test2.o: U i 00000000 T main $ gcc test1.o test2.o -o test test2.o: In function `main': (.text+0xf): undefined reference to `i' collect2: ld returned 1 exit status the `nm` output is irrelevant ... nm shows debugging symbols, not all symbols. that's why you'll want to stick with readelf ... seems like the next bug is that strip will drop COM objects (uninitialized/bss) $ cat test.c int i; int j = 1; $ gcc -c test.c $ readelf -s test.o | grep OBJ 7: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 j 8: 0000000000000004 4 OBJECT GLOBAL DEFAULT COM i $ strip --strip-unneeded test.o $ readelf -s test.o | grep OBJ 7: 0000000000000000 4 OBJECT GLOBAL DEFAULT 2 j $ ... old bug: http://sourceware.org/bugzilla/show_bug.cgi?id=4716 new bug: http://sourceware.org/bugzilla/show_bug.cgi?id=9933 upstream has committed a patch for the issue. i dont suppose you can retest fpc to see if it fixes things ? you can simply put it into /etc/portage/patches/sys-devel/binutils/ and the ebuild will automatically apply it ... The build of lazarus finishes successfully with the patch applied, so it seems there are no other remaining issues. added strip fix to 2.19.1-r1 ... i'd like to get this stabilized soonish, so that's why i'm not doing another 2.18 -r# http://sources.gentoo.org/gentoo/src/patchsets/binutils/2.19.1/10_all_binutils-2.18-strip-common.patch?r1=1.1&r2=1.2 |