Summary: | ld --gc-sections *.o produces big(ger than possible) executables | ||
---|---|---|---|
Product: | binutils | Reporter: | Denis Vlasenko <vda.linux> |
Component: | binutils | Assignee: | unassigned |
Status: | RESOLVED INVALID | ||
Severity: | normal | CC: | bug-binutils |
Priority: | P2 | ||
Version: | 2.17 | ||
Target Milestone: | --- | ||
Host: | i386-pc-linux-gnu | Target: | i386-pc-linux-gnu |
Build: | i386-pc-linux-gnu | Last reconfirmed: | |
Attachments: |
objdump of ld *.o result
objdump of ld main.o lib.a result |
Description
Denis Vlasenko
2006-10-06 15:47:14 UTC
Created attachment 1354 [details]
objdump of ld *.o result
Created attachment 1355 [details]
objdump of ld main.o lib.a result
getpwnam_r is kept because you are linking against a shared libc that also defines this symbol. In this case the linker keeps your getpwnam_r, because it is assumed you are defining a function to override the one in the shared lib. The linker can't know whether getpwnam_r is actually called, because there might be a call from a dlopen'd library at runtime. |