ambiguous file formats coff-x86_64 / pe-x86_64

Jan Beulich JBeulich@suse.com
Thu Dec 22 14:43:00 GMT 2016


Hello,

in the Xen Project we've recently switched to linking in a trivial COFF
object to trigger the COFF/PE build ID machinery when building an EFI
binary. We've now had reports that on binutils with both coff-x86_64
and pe-x86_64 configured in (but defaulting to ELF), linking fails due
to the object being ambiguous. Afaict (from going through config.bfd)
it is not safe to force the object type to either of the two types, as
each of the two could be unavailable in a particular binutils build (the
only requirement is pei-x86_64 to be available, which different
targets select together with one or the other).

Are there ways to cleanly deal with this situation? Is there perhaps
a way to tell the linker to prefer one format when both are available?
The object file contains no sections or symbols, and hence it is -
afaict - completely benign which of the two formats it would get
handled with.

I'd like to avoid the uglier approach of scanning the list of
supported targets from the help output of one of the tools, or
trying one and falling back to the other if the first fails ...

Thanks, Jan



More information about the Binutils mailing list