binutils/ld.bfd, -fdebug-prefix-map, FILE entries (was: Re: dietlibc; build path issue on ARM despite -fdebug-prefix-map)

Holger Levsen holger at
Thu Mar 9 13:33:51 UTC 2017

Hi Christian,

On Sat, Feb 18, 2017 at 02:19:52PM +0100, Christian Seiler wrote:
> I believe the issue stems from this code in binutils/bfd:
> The file name at this point is just the argument passed to the linker,
> irrespective of whether it's an absolute path or a relative one, and
> no prefix is applied at all.
> The initial problem with dietlibc is that on ARM paltforms the
> startup code has local symbols in the assembly, which it doesn't
> on x86, so the problem has never surfaced on x86 in the past.
> Which means this is a broader class of bugs that every time one
> has an assembly file that doesn't contain a ".file" directive
> and contains local symbols, ld.bfd will output a FILE entry
> which may contain an absolute path of the object file (depending on
> how the file name was passed to the linker), which can break
> reproducibility.
> For dietlibc (after Stretch), I can just add .file directives
> everywhere, so I can work around this issue.
> But to make sure this doesn't happen at all anymore (there might
> be other software with hand-crafted assembly out there that has
> similar issues), I believe binutils should also be altered to
> support SOURCE_PREFIX_MAP in these cases.
> Unfortunately, I know way too little about the details of binutils
> to feel comfortable in creating a patch (it was hard enough to find
> the suspected place where the path is injected), so all I can do 
> here is report my findings. Hopefully someone with more binutils-fu
> is able to pick this up.

do you know whether this has been fixed in the recent binutils uploads?

if not maybe you can file these findings as a bug, so they don't get lost 
on the mailinglist?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <>

More information about the Reproducible-builds mailing list