bfd_get_target_info problem on Power and IBM Z

Andreas Krebbel krebbel@linux.ibm.com
Tue Jan 11 08:44:25 GMT 2022


Hi,

using bfd_get_target_info to determine the default architecture fails
on Power and IBM Z. The reason appears to be that for both targets all
printable target names contain a colon. The _bfd_find_arch_match
function in targets.c walks over the archs searching for one without a
colon in it to pick it as default.

To me this looks like a redundant way of defining what the default
arch is. In targets.c this is probably done because there we do not
have access to the the_default flag from bfd_arch_info, so we have to
rely on just the arch strings to figure it out.

I'm not sure whether we can adjust the printable names for Power and Z
or define a dummy default arch without breaking things somewhere else.

Should we rather try to find a way to make the default flag available
in targets.c?

Bye,

Andreas


More information about the Binutils mailing list