Summary: | main: hidden symbol `foo' isn't defined | ||
---|---|---|---|
Product: | binutils | Reporter: | H.J. Lu <hjl.tools> |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.26 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
H.J. Lu
2015-07-27 12:46:13 UTC
This behavior is expected. When linker first checks foo.o in libbar.a, foo is defined in libfoo.so. Linker decides not to pull in foo.o. Then linker pulls in xxx.o in libbar.a to resolve reference to xxx, which leads to bar.o in libbar.a pulled in for bar.o and results in turning foo into hidden. Linker won't rescan libbar.a for foo. You should use # gcc -o main main.o libbar.a libfoo.so libbar.a -Wl,-R. |