diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-03-20 19:16:25 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2005-03-20 19:16:25 +0000 |
commit | ae5eb59982615b4f8a657aaac2c5113b2021a490 (patch) | |
tree | 1a963caf2574ca0ec81bfaf3ac35283a8f6c2748 | |
parent | cefe4a85d08d3b79c0a374163154329771dcdb6c (diff) | |
download | gdb-ae5eb59982615b4f8a657aaac2c5113b2021a490.tar.gz |
* elf32-arm.c (elf32_arm_modify_segment_map): New function.
(elf32_arm_additional_program_headers): Likewise.
(elf_backend_modify_segment_map): Define.
(elf_backend_additional_program_headers): Likewise.
(elf32_arm_symbian_modify_segment_map): Use
elf32_arm_modify_segment_map.
* binutils/readelf.c (get_arm_segment_type): New function.
(get_segment_type): Use it.
* arm.h (PT_ARM_EXIDX): Define.
-rw-r--r-- | bfd/ChangeLog | 11 | ||||
-rw-r--r-- | bfd/elf32-arm.c | 58 | ||||
-rw-r--r-- | bfd/po/es.gmo | bin | 71201 -> 84719 bytes | |||
-rw-r--r-- | include/elf/ChangeLog | 6 | ||||
-rw-r--r-- | include/elf/arm.h | 3 |
5 files changed, 75 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9114c4e5ccd..3bbd61f28db 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2005-03-17 Paul Brook <paul@codesourcery.com> + Dan Jacobowitz <dan@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + + * elf32-arm.c (elf32_arm_modify_segment_map): New function. + (elf32_arm_additional_program_headers): Likewise. + (elf_backend_modify_segment_map): Define. + (elf_backend_additional_program_headers): Likewise. + (elf32_arm_symbian_modify_segment_map): Use + elf32_arm_modify_segment_map. + 2005-03-16 Alan Modra <amodra@bigpond.net.au> * elf32-ppc.c (ppc_elf_create_linker_section): Set SEC_LINKER_CREATED diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 660a9909dc0..f438f03e707 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -5710,6 +5710,55 @@ elf32_arm_swap_symbol_out (bfd *abfd, bfd_elf32_swap_symbol_out (abfd, src, cdst, shndx); } +/* Add the PT_ARM_EXIDX program header. */ + +static bfd_boolean +elf32_arm_modify_segment_map (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + struct elf_segment_map *m; + asection *sec; + + sec = bfd_get_section_by_name (abfd, ".ARM.exidx"); + if (sec != NULL && (sec->flags & SEC_LOAD) != 0) + { + /* If there is already a PT_ARM_EXIDX header, then we do not + want to add another one. This situation arises when running + "strip"; the input binary already has the header. */ + m = elf_tdata (abfd)->segment_map; + while (m && m->p_type != PT_ARM_EXIDX) + m = m->next; + if (!m) + { + m = bfd_zalloc (abfd, sizeof (struct elf_segment_map)); + if (m == NULL) + return FALSE; + m->p_type = PT_ARM_EXIDX; + m->count = 1; + m->sections[0] = sec; + + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } + } + + return TRUE; +} + +/* We may add a PT_ARM_EXIDX program header. */ + +static int +elf32_arm_additional_program_headers (bfd *abfd) +{ + asection *sec; + + sec = bfd_get_section_by_name (abfd, ".ARM.exidx"); + if (sec != NULL && (sec->flags & SEC_LOAD) != 0) + return 1; + else + return 0; +} + /* We use this to override swap_symbol_in and swap_symbol_out. */ const struct elf_size_info elf32_arm_size_info = { sizeof (Elf32_External_Ehdr), @@ -5780,6 +5829,9 @@ const struct elf_size_info elf32_arm_size_info = { #define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol #define elf_backend_symbol_processing elf32_arm_symbol_processing #define elf_backend_size_info elf32_arm_size_info +#define elf_backend_modify_segment_map elf32_arm_modify_segment_map +#define elf_backend_additional_program_headers \ + elf32_arm_additional_program_headers #define elf_backend_can_refcount 1 #define elf_backend_can_gc_sections 1 @@ -5914,8 +5966,7 @@ elf32_arm_symbian_begin_write_processing (bfd *abfd, static bfd_boolean elf32_arm_symbian_modify_segment_map (bfd *abfd, - struct bfd_link_info *info - ATTRIBUTE_UNUSED) + struct bfd_link_info *info) { struct elf_segment_map *m; asection *dynsec; @@ -5932,7 +5983,8 @@ elf32_arm_symbian_modify_segment_map (bfd *abfd, elf_tdata (abfd)->segment_map = m; } - return TRUE; + /* Also call the generic arm routine. */ + return elf32_arm_modify_segment_map (abfd, info); } #undef elf32_bed diff --git a/bfd/po/es.gmo b/bfd/po/es.gmo Binary files differindex 3b3adfc6aab..cff702a204f 100644 --- a/bfd/po/es.gmo +++ b/bfd/po/es.gmo diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 91a81b99594..46df13d03a0 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,9 @@ +2005-03-17 Paul Brook <paul@codesourcery.com> + Dan Jacobowitz <dan@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + + * arm.h (PT_ARM_EXIDX): Define. + 2005-03-02 Daniel Jacobowitz <dan@codesourcery.com> Joseph Myers <joseph@codesourcery.com> diff --git a/include/elf/arm.h b/include/elf/arm.h index 78678295d9c..de3ed066441 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -37,6 +37,9 @@ #define EF_ARM_VFP_FLOAT 0x400 #define EF_ARM_MAVERICK_FLOAT 0x800 +/* Frame unwind information */ +#define PT_ARM_EXIDX (PT_LOPROC + 1) + /* Other constants defined in the ARM ELF spec. version B-01. */ #define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */ #define EF_ARM_DYNSYMSUSESEGIDX 0x08 /* NB conflicts with EF_APCS26 */ |