From 69b975477d1abc861452d7cb2c82190e44c47a94 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 22 Apr 2004 09:49:03 +0000 Subject: Apply Bruno de Bus's patch to record the ARM mapping symbol state on a per- section basis and to switch to the MAP_DATA state when emitting literal pools. --- gas/config/tc-arm.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'gas/config/tc-arm.c') diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index a7ebc51..2092659 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -1,5 +1,5 @@ /* tc-arm.c -- Assemble for the ARM - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -2829,13 +2829,6 @@ validate_offset_imm (val, hwse) #ifdef OBJ_ELF -enum mstate -{ - MAP_DATA, - MAP_ARM, - MAP_THUMB -}; - /* This code is to handle mapping symbols as defined in the ARM ELF spec. (This text is taken from version B-02 of the spec): @@ -2910,10 +2903,11 @@ enum mstate the EABI (which is still under development), so they are not implemented here. */ +static enum mstate mapstate = MAP_UNDEFINED; + static void mapping_state (enum mstate state) { - static enum mstate mapstate = MAP_DATA; symbolS * symbolP; const char * symname; int type; @@ -2939,10 +2933,14 @@ mapping_state (enum mstate state) symname = "$t"; type = BSF_FUNCTION; break; + case MAP_UNDEFINED: + return; default: abort (); } + seg_info (now_seg)->tc_segment_info_data = state; + symbolP = symbol_new (symname, now_seg, (valueT) frag_now_fix (), frag_now); symbol_table_insert (symbolP); symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; @@ -2983,16 +2981,7 @@ arm_elf_change_section (void) if ((flags & SEC_ALLOC) == 0) return; - if (flags & SEC_CODE) - { - if (thumb_mode) - mapping_state (MAP_THUMB); - else - mapping_state (MAP_ARM); - } - else - /* This section does not contain code. Therefore it must contain data. */ - mapping_state (MAP_DATA); + mapstate = seg_info (now_seg)->tc_segment_info_data; } #else #define mapping_state(a) @@ -3115,6 +3104,8 @@ s_ltorg (ignored) || pool->next_free_entry == 0) return; + mapping_state (MAP_DATA); + /* Align pool as you have word accesses. Only make a frag if we have to. */ if (!need_pass_2) @@ -13878,6 +13869,9 @@ arm_cleanup () { /* Put it at the end of the relevent section. */ subseg_set (pool->section, pool->sub_section); +#ifdef OBJ_ELF + arm_elf_change_section (); +#endif s_ltorg (0); } } -- cgit v1.1