bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/24613] ld --help for -z defs and --no-undefined


From: nickc at redhat dot com
Subject: [Bug ld/24613] ld --help for -z defs and --no-undefined
Date: Tue, 04 Jun 2019 14:26:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24613

Nick Clifton <nickc at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2019-06-04
                 CC|                            |nickc at redhat dot com
     Ever confirmed|0                           |1

--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
Hi Dilyan,

> ld.bfd --help prints for the same
> --no-undefined              Do not allow unresolved references in object
> files
> -z defs                     Report unresolved symbols in object files
> 
> which suggests, that the two directives do different things.

And indeed this is true.  The --no-undefined option has slightly
different semantics to -z defs.  In particular if the --warn-unresolved-symbols
option has been specified earlier in the list of linker command
line options, then the --no-undefined option will only generate
a warning, rather than an error.  The -z defs option however will
always generate an error, even if --warn-unresolved-symbols has
been enabled.

For gold however, this situation is subtly different.  With gold
the -z defs option is affected by the --warn-unresolved-symbols
option, so -z defs and --no-undefined are the same option.

So in theory we ought to change one of the linkers so that the behaviour
matches the other.  In practice however I think that this would be a bad
idea as it is bound to cause friction with users who do not like the change.

So instead I think that it would be best to clarify the --help output.
What do you think of the following ?

ld.bfd
 --no-undefined  Report unresolved references in object files
 -z defs         Generate errors for unresolved references in object files

I am not 100% sure of the effects of ld.gold's options on non-object
files, so I am off a mind to leave its --help output alone.

Cheers
  Nick

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]