aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-10-29 15:37:43 +1030
committerAlan Modra <amodra@gmail.com>2013-10-30 13:40:21 +1030
commit6911b7dcb8ea17f8b811578dd4ac1ab7bb675e7b (patch)
tree0181671770254c68868ad161b4f207805969ef25 /binutils
parentee67d69a3ff0eed25d98c5e97ed6c3ede8069edc (diff)
downloadfsf-binutils-gdb-6911b7dcb8ea17f8b811578dd4ac1ab7bb675e7b.zip
fsf-binutils-gdb-6911b7dcb8ea17f8b811578dd4ac1ab7bb675e7b.tar.gz
fsf-binutils-gdb-6911b7dcb8ea17f8b811578dd4ac1ab7bb675e7b.tar.bz2
Add ELFv2 .localentry support.
This defines the ELF symbol st_other field used to encode the number of instructions between a function "global entry" and its "local entry", and adds support related to the local entry offset. include/elf/ * ppc64.h (STO_PPC64_LOCAL_BIT, STO_PPC64_LOCAL_MASK): Define. (ppc64_decode_local_entry, ppc64_encode_local_entry): New functions. (PPC64_LOCAL_ENTRY_OFFSET, PPC64_SET_LOCAL_ENTRY_OFFSET): Define. bfd/ * elf64-ppc.c (struct ppc_stub_hash_entry): Add "other". (stub_hash_newfunc): Init new ppc_stub_hash_entry field, and one we forgot, "plt_ent". (ppc64_elf_add_symbol_hook): Check ELFv1 objects don't have st_other bits only valid in ELFv2. (ppc64_elf_merge_symbol_attribute): New function. (ppc_type_of_stub): Add local_off param to test branch range. (ppc_build_one_stub): Adjust destinations for ELFv2 locals. (ppc_size_one_stub, toc_adjusting_stub_needed): Similarly. (ppc64_elf_size_stubs): Pass local_off to ppc_type_of_stub. Set "other" field. (ppc64_elf_relocate_section): Adjust destination for ELFv2 local calls. gas/ * config/tc-ppc.c (md_pseudo_table): Add .localentry. (ppc_elf_localentry): New function. (ppc_force_relocation): Force relocs on all branches to localenty symbols. (ppc_fix_adjustable): Don't reduce such symbols to section+offset. binutils/ * readelf.c (get_ppc64_symbol_other): New function. (get_symbol_other): Use it for EM_PPC64.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/readelf.c16
2 files changed, 21 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 8457dc7..9774dea 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * readelf.c (get_ppc64_symbol_other): New function.
+ (get_symbol_other): Use it for EM_PPC64.
+
2013-10-30 Alan Modra <amodra@gmail.com>
* readelf.c (get_machine_flags): Display ABI version for EM_PPC64.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index ab2943d..c99b46e 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -9211,6 +9211,19 @@ get_ia64_symbol_other (unsigned int other)
}
static const char *
+get_ppc64_symbol_other (unsigned int other)
+{
+ if (PPC64_LOCAL_ENTRY_OFFSET (other) != 0)
+ {
+ static char buf[32];
+ snprintf (buf, sizeof buf, _("<localentry>: %d"),
+ PPC64_LOCAL_ENTRY_OFFSET (other));
+ return buf;
+ }
+ return NULL;
+}
+
+static const char *
get_symbol_other (unsigned int other)
{
const char * result = NULL;
@@ -9227,6 +9240,9 @@ get_symbol_other (unsigned int other)
case EM_IA_64:
result = get_ia64_symbol_other (other);
break;
+ case EM_PPC64:
+ result = get_ppc64_symbol_other (other);
+ break;
default:
break;
}