Summary: | ld -e (--entry) is too quiet on bad symbol names | ||
---|---|---|---|
Product: | binutils | Reporter: | Daniel Jacobowitz <drow> |
Component: | ld | Assignee: | unassigned |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils |
Priority: | P2 | ||
Version: | 2.19 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2008-01-09 12:59:06 |
Description
Daniel Jacobowitz
2008-01-02 15:43:00 UTC
Hi Daniel, Do you have a test case that reproduces this problem ? I tried the following: % cat fred.s .global foo .global bar foo: nop bar: nop % as fred.s -o fred.o % ld -e does-not-exist fred.o ld: warning: cannot find entry symbol does-not-exist; defaulting to 0000000000008000 ie a warning message *was* produced. This was with an arm-eabi toolchain built from today's sources on a 64-bit host, so maybe one of these factors is connected with the generation of the warning message. Cheers Nick Oops, the message is only suppressed for -shared. I was building an executable shared library. Does entry_symbol.name get set from both the default linker script and the command line? Not warning with -shared and ENTRY is probably appropriate, since all the existing -shared linker scripts have an ENTRY and most shared libraries are executable. Hi Daniel, > Does entry_symbol.name get set from both the default linker script and the > command line? Yes. See ld/ldlang.c:lang_add_entry(). It has a parameter which tells it whether the symbol is being set from a linker script (default or otherwise) or from the command line. The command line takes precedence. > Not warning with -shared and ENTRY is probably appropriate, since > all the existing -shared linker scripts have an ENTRY and most shared > libraries are executable. Agreed. Cheers Nick Sorry, that's not what I meant. -shared, ENTRY, and not found is valid not to warn. -shared, -e, and not found is different. What do you think of this? if (link_info.relocatable || link_info.shared) - warn = FALSE; + warn = entry_from_cmdline; else Hi Daniel, Sorry for being so dense! Yes your patch will work and I have checked it in along with this ChangeLog entry. OK to close this PR now ? :-) Cheers Nick ld/ChangeLog 2008-01-10 Daniel Jacobowitz <drow@sources.redhat.com> PR ld/5533 * ldlang.c (lang_end): Issue a warning for a missing start symbol of a shared library if the symbol was specified on the command line. Thanks! |