From ee67d69a3ff0eed25d98c5e97ed6c3ede8069edc Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 29 Oct 2013 15:06:09 +1030 Subject: Add .abiversion related support for ELFv2 Defines bits in ELF e_flags to differentiate ELFv2 objects from ELFv2, adds .abiversion directive to explicitly choose the ABI, and code to check and automatically select ABI. include/elf/ * ppc64.h (EF_PPC64_ABI): Define. bfd/ * elf64-ppc.c (abiversion, set_abiversion): New functions. (ppc64_elf_get_synthetic_symtab): Handle ELFv2 objects without .opd. (struct ppc_link_hash_table): Add opd_abi. (ppc64_elf_check_relocs): Check no .opd with ELFv2. (ppc64_elf_merge_private_bfd_data): New function. (ppc64_elf_print_private_bfd_data): New function. (ppc64_elf_tls_setup): Set htab->opd_abi. (ppc64_elf_size_dynamic_sections): Don't emit OPD related dynamic tags for ELFv2. (ppc_build_one_stub): Use R_PPC64_IRELATIVE for ELFv2 ifunc. (ppc64_elf_finish_dynamic_symbol): Likewise binutils/ * readelf.c (get_machine_flags): Display ABI version for EM_PPC64. gas/ * config/tc-ppc.c: Include elf/ppc64.h. (ppc_abiversion): New variable. (md_pseudo_table): Add .abiversion. (ppc_elf_abiversion, ppc_elf_end): New functions. * config/tc-ppc.h (md_end): Define. --- binutils/ChangeLog | 4 ++++ binutils/readelf.c | 10 ++++++++++ 2 files changed, 14 insertions(+) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index ae50526..8457dc7 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2013-10-30 Alan Modra + + * readelf.c (get_machine_flags): Display ABI version for EM_PPC64. + 2013-10-24 Nick Clifton * nm.c (display_rel_file): Treat bfd_error_no_symbols as diff --git a/binutils/readelf.c b/binutils/readelf.c index 7920100..ab2943d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -2461,6 +2461,16 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) strcat (buf, _(", relocatable-lib")); break; + case EM_PPC64: + if (e_flags & EF_PPC64_ABI) + { + char abi[] = ", abiv0"; + + abi[6] += e_flags & EF_PPC64_ABI; + strcat (buf, abi); + } + break; + case EM_V800: if ((e_flags & EF_RH850_ABI) == EF_RH850_ABI) strcat (buf, ", RH850 ABI"); -- cgit v1.1