From 40a18ebd3ae910042b4d7bf053a41c247db7cbc1 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 1 Oct 2004 12:59:42 +0000 Subject: The patch below adds binutils support for the SHT_ARM_EXIDX, as defined by the ARM EABI. --- gas/ChangeLog | 7 +++++++ gas/config/tc-arm.c | 14 ++++++++++++++ gas/config/tc-arm.h | 3 +++ 3 files changed, 24 insertions(+) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index c328820..3f8fff4 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2004-10-01 Paul Brook + + * config/tc-arm.c (arm_elf_section_type): New function. + (arm_elf_change_section): Set section link for exidx sections. + * config/tc-arm.h (arm_elf_section_type): Add prototype. + (md_elf_section_type): Define. + 2004-10-01 Bill Farmer * config/tc-pdp11.c (md_apply_fix3): Change to sign of the SOB diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 752cd3c..9770ccd 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1338,6 +1338,11 @@ arm_elf_change_section (void) { flagword flags; + /* Link an unlinked unwind index table section to the .text section. */ + if (elf_section_type (now_seg) == SHT_ARM_EXIDX + && elf_linked_to_section (now_seg) == NULL) + elf_linked_to_section (now_seg) = text_section; + if (!SEG_NORMAL (now_seg)) return; @@ -1349,6 +1354,15 @@ arm_elf_change_section (void) mapstate = seg_info (now_seg)->tc_segment_info_data; } + +int +arm_elf_section_type (const char * str, size_t len) +{ + if (len == 5 && strncmp (str, "exidx", 5) == 0) + return SHT_ARM_EXIDX; + + return -1; +} #else #define mapping_state(a) #endif /* OBJ_ELF */ diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index 4e791a0..fb8ca8d 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -167,6 +167,7 @@ struct fix; # define DWARF2_LINE_MIN_INSN_LENGTH 2 # define obj_frob_symbol(sym, punt) armelf_frob_symbol ((sym), & (punt)) # define md_elf_section_change_hook() arm_elf_change_section () +# define md_elf_section_type(str, len) arm_elf_section_type (str, len) # define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" # define LOCAL_LABEL_PREFIX '.' # define TC_SEGMENT_INFO_TYPE enum mstate @@ -209,3 +210,5 @@ extern void cons_fix_new_arm (fragS *, int, int, expressionS *); extern void arm_init_frag (struct frag *); extern void arm_handle_align (struct frag *); extern bfd_boolean arm_fix_adjustable (struct fix *); +extern int arm_elf_section_type (const char *, size_t); + -- cgit v1.1