aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2026-01-03 13:51:21 +1030
committerAlan Modra <amodra@gmail.com>2026-01-04 13:14:22 +1030
commitef6aff2be44b172a874df036c7d270301b47005a (patch)
tree8377b27f2c95bf4c06f5e9b846f990e3374451e2 /gdb/python/python.c
parent39d685b15e4ad7cf11c1d7a5cb032191c909405a (diff)
downloadbinutils-ef6aff2be44b172a874df036c7d270301b47005a.zip
binutils-ef6aff2be44b172a874df036c7d270301b47005a.tar.gz
binutils-ef6aff2be44b172a874df036c7d270301b47005a.tar.bz2
ELF OSABI matching
Currently a binutils ELF target with ELF_OSABI defined to something other than the default ELFOSABI_NONE will only accept object files with e_ident[EI_OSABI] having the value ELF_OSABI. An ELF target with ELF_OSABI as ELFOSABI_NONE will match any e_ident[EI_OSABI] value, and typically that target's object files will have ELFOSABI_NONE or one other value in e_ident[EI_OSABI]. Given an object file with that "other value" we'd like to be able to choose the correct target but currently have no way to do so. This patch is a step towards implementing better target matching. It does so by adding an ELF_OSABI_EXACT to the target description, setting that true for all targets that currently define ELF_OSABI, and testing the new flag for exact matching. This will allow a future patch to define ELF_OSABI without forcing exact matching but giving a hint as to the best target match. Some other tweaks are done as shown by the changelog below but no user functional changes should be seen with this patch. * elf-bfd.h (struct elf_backend_data): Add osabi_exact. * elf.c (_bfd_elf_final_write_processing): Only set e_ident from elf_osabi when osabi_exact. * elfcode.h (elf_object_p): Test osabi_exact to reject mismatching e_ident. Remove unnecessary EM_NONE test. * elfcore.h (elf_core_file_p): Likewise. * elfxx-target.h (ELF_OSABI_EXACT): Provide default of 0, and init elfNN_bed. (elf_match_priority): Handle ELF_OSABI_EXACT. * elf32-arm.c (ELF_OSABI_EXACT): Define and undef along with ELF_OSABI. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-tic6x.c: Likewise. * elf32-visium.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-ia64-vms.c: Likewise. * elf64-mips.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfn32-mips.c: Likewise. * elfnn-ia64.c: Likewise. * elf32-msp430.c: Likewise. Don't define ELF_OSABI to ELFOSABI_NONE.
Diffstat (limited to 'gdb/python/python.c')
0 files changed, 0 insertions, 0 deletions