[PATCH users/roland/ld-depfile] ld, gold: Add --dependency-file option.

Roland McGrath mcgrathr@google.com
Mon Jun 22 23:44:26 GMT 2020


On Sun, Jun 21, 2020 at 9:43 PM Alan Modra <amodra@gmail.com> wrote:
> > The criterion remains the same: all files the linker read while
> > producing that output.
>
> You do know that your patch doesn't meet that criterion, don't you?

I didn't.  That's the intent of the change.  I just noticed one case
I'd missed in the Gold implementation: the --section-ordering-file
file.  The new version of the branch covers that too.
Please tell me what input files I've missed in the BFD implementation,
or if there are any remaining omissions in the Gold implementation.

> Not that I'm asking you to meet your own criterion fully, that would
> be ridiculous.

It is not.  I want that asked of me.  The one class of exception I
intend but didn't explicitly state in the criterion is things like
gettext translations and /etc/localtime that we can say the linker
doesn't know it's accessing and linker logic to produce the output
file could never be affected by.

> I just don't see the utility of reporting as dependencies shared
> libraries that won't be loaded by the linker and that can't effect the
> final output under anything like normal circumstances.

I think there is clear utility and safety in keeping the criterion as
simple as possible: all files the linker read (modulo ).  If someone
has to exercise judgment about whether a file actually read by the
linker logic truly affected the final output, then there's always a
chance that judgment is in error.  The purpose of a dependency file is
to ensure incremental rebuilds happen when necessary, and false
positives in uncommon circumstances are harmless enough while any
false negative ever is potentially quite harmful to someone's
productivity.


Thanks,
Roland


More information about the Binutils mailing list