aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-04-29 09:24:42 +0100
committerNick Clifton <nickc@redhat.com>2016-04-29 09:24:42 +0100
commit5522f910cb539905d6adfdceab208ddfa5e84557 (patch)
tree0e266a54bdd71c153b10e11319699d78350b6c33 /binutils
parent2deb93c7a7708ed164e4b10afb9d6a885d4615c6 (diff)
downloadgdb-5522f910cb539905d6adfdceab208ddfa5e84557.zip
gdb-5522f910cb539905d6adfdceab208ddfa5e84557.tar.gz
gdb-5522f910cb539905d6adfdceab208ddfa5e84557.tar.bz2
Enhance support for copying and stripping Solaris and ARM binaries.
PR 19938 bfd * elf-bfd.h (struct elf_backend_data): Rename elf_backend_set_special_section_info_and_link to elf_backend_copy_special_section_fields. * elfxx-target.h: Likewise. * elf.c (section_match): Ignore the SHF_INFO_LINK flag when comparing section flags. (copy_special_section_fields): New function. (_bfd_elf_copy_private_bfd_data): Copy the EI_ABIVERSION field. Perform two scans over special sections. The first one looks for a direct mapping between the output section and an input section. The second scan looks for a possible match based upon section characteristics. * elf32-arm.c (elf32_arm_copy_special_section_fields): New function. Handle setting the sh_link field of SHT_ARM_EXIDX sections. * elf32-i386.c (elf32_i386_set_special_info_link): Rename to elf32_i386_copy_solaris_special_section_fields. * elf32-sparc.c (elf32_sparc_set_special_section_info_link): Rename to elf32_sparc_copy_solaris_special_section_fields. * elf64-x86-64.c (elf64_x86_64_set_special_info_link): Rename to elf64_x86_64_copy_solaris_special_section_fields. binutils* readelf.c (get_solaris_segment_type): New function. (get_segment_type): Call it.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c22
2 files changed, 27 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 7a19cc7..7eea2c0 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2016-04-29 Nick Clifton <nickc@redhat.com>
+
+ PR 19938
+ * readelf.c (get_solaris_segment_type): New function.
+ (get_segment_type): Call it.
+
2016-04-28 Nick Clifton <nickc@redhat.com>
* po/zh_CN.po: Updated Chinese (simplified) translation.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index cf91755..b6454d3 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -3689,6 +3689,23 @@ get_tic6x_segment_type (unsigned long type)
}
static const char *
+get_solaris_segment_type (unsigned long type)
+{
+ switch (type)
+ {
+ case 0x6464e550: return "PT_SUNW_UNWIND";
+ case 0x6474e550: return "PT_SUNW_EH_FRAME";
+ case 0x6ffffff7: return "PT_LOSUNW";
+ case 0x6ffffffa: return "PT_SUNWBSS";
+ case 0x6ffffffb: return "PT_SUNWSTACK";
+ case 0x6ffffffc: return "PT_SUNWDTRACE";
+ case 0x6ffffffd: return "PT_SUNWCAP";
+ case 0x6fffffff: return "PT_HISUNW";
+ default: return NULL;
+ }
+}
+
+static const char *
get_segment_type (unsigned long p_type)
{
static char buff[32];
@@ -3758,7 +3775,10 @@ get_segment_type (unsigned long p_type)
result = get_ia64_segment_type (p_type);
break;
default:
- result = NULL;
+ if (elf_header.e_ident[EI_OSABI] == ELFOSABI_SOLARIS)
+ result = get_solaris_segment_type (p_type);
+ else
+ result = NULL;
break;
}