Bug 29136 - ld: ENTRY(no_such_symbol) in -shared mode does not report a warning
Summary: ld: ENTRY(no_such_symbol) in -shared mode does not report a warning
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-10 06:32 UTC by Fangrui Song
Modified: 2022-05-18 15:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2022-05-10 06:32:26 UTC
as /dev/null -o a.o
echo 'ENTRY(no_such_symbol)' > a.t
ld.bfd -T a.t -shared a.o


Both `ld.bfd -e no_such_symbol -shared a.o` and (executable link) `ld.bfd -T a.t a.o` have a warning: `cannot find entry symbol ...; defaulting to ...`
Comment 1 Nick Clifton 2022-05-18 15:47:24 UTC
Hi Fanguri,

  Shared objects do not need an entry point, so not complaining about
  ENTRY(no_such_symbol) makes sense.

  In theory then the real bug is that "-e no_such_symbol -shared" triggers
  a warning.  Although it could be argued that any use of -e should refer
  to a valid symbol, even if it is not used.

  Thoughts ?

Cheers
  Nick