Summary: | Unused symbols in dynamic symbol table | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | normal | CC: | amodra, nickc, rguenth |
Priority: | P2 | ||
Version: | 2.36 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | A patch |
Description
H.J. Lu
2020-07-31 11:41:28 UTC
[hjl@gnu-cfl-2 pr26324]$ cat pr15146a.c extern int xxx; int bar (void) { return xxx; } int main () { return 0; } [hjl@gnu-cfl-2 pr26324]$ cat pr15146b.c int xxx = 3; [hjl@gnu-cfl-2 pr26324]$ cat pr15146c.c [hjl@gnu-cfl-2 pr26324]$ make gcc -B./ -O2 -g -o x -Wl,-R,. \ -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed pr15146a.o pr15146c.so ./ld: /tmp/ccHirkTe.debug.temp.o: undefined reference to symbol 'xxx' ./ld: ./pr15146b.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make: *** [Makefile:15: x] Error 1 [hjl@gnu-cfl-2 pr26324]$ |