Feature request: improved build-id generation

Nick Clifton nickc@redhat.com
Thu Mar 15 11:36:00 GMT 2018


Hi Guys,

>> I think Fedora should be able to ask its tool chain to insert the
>> extra data rather than hacking it in after the fact.

I'll just note that another way to insert data into a linked binary
is to use a linker script fragment referenced from the command line.
I doubt that this would be any better than creating a "magic .o" file,
but it is worth knowing.


>> Asking Fedora to use --defsym for this purpose is IMO a non-starter,

I have to agree with Cary here - why is this idea a non-starter ?


>> as is asking
>> Fedora to come up with some magic .o file and linking it into every
>> object.

If you are primarily concerned with Fedora, then you could use the
annobin project to insert this data for you.  That way you would not
need to change the linker at all.


>> This feature should be available on the command line, and, in
>> particular, it should be usable the same way that the toolchain's
>> hardening flags are available to rpm.
> 
> What does that mean? What makes an option usable the same way that
> hardening flags are?

I think that Andy is referring to the way that the redhat-rpm-config
package creates macros that insert hardening options into the gcc
command line of rpms that build using those macros...  The macros make
use of gcc's -spec command line option to add compiler and linker flags
in a way that should not cause conflicts if a different compiler is 
being used.


Andy - I do not want you to have the impression that we do not care about
your new feature request.  We do.  It is just that we would prefer to 
explore alternatives first and only add new code if it really is going to
provide a benefit.

Cheers
  Nick



More information about the Binutils mailing list