In rs6000_aix_osabi_sniffer, is it really necessary to check whether bfd_get_flavour (abfd) == bfd_target_xcoff_flavour? You've already restricted the sniffer to bfd_target_xcoff_flavour when you called gdbarch_register_osabi_sniffer, if I'm reading gdbarch_lookup_osabi correctly.