Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gas/ChangeLog,v retrieving revision 1.2071 diff -p -r1.2071 ChangeLog *** ChangeLog 7 Mar 2004 15:00:15 -0000 1.2071 --- ChangeLog 9 Mar 2004 10:59:13 -0000 *************** *** 1,3 **** --- 1,10 ---- + 2004-03-09 Bruno De Bus + + * config/tc-arm.c (mapping_state, s_ltorg, arm_cleanup): + Fixed arm mapping symbols + * config/tc-arm.h: moved the definition for the arm mapping + states here and added the state to each section + 2004-03-07 Andreas Schwab * doc/c-hppa.texi (HPPA Directives): Fix typo. Index: config/tc-arm.c =================================================================== RCS file: /cvs/src/src/gas/config/tc-arm.c,v retrieving revision 1.163 diff -p -r1.163 tc-arm.c *** config/tc-arm.c 18 Feb 2004 16:28:17 -0000 1.163 --- config/tc-arm.c 9 Mar 2004 10:59:14 -0000 *************** validate_offset_imm (val, hwse) *** 2823,2835 **** #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): --- 2823,2828 ---- *************** enum mstate *** 2904,2913 **** the EABI (which is still under development), so they are not implemented here. */ ! static void mapping_state (enum mstate state) { - static enum mstate mapstate = MAP_DATA; symbolS * symbolP; const char * symname; int type; --- 2897,2907 ---- 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) { symbolS * symbolP; const char * symname; int type; *************** mapping_state (enum mstate state) *** 2925,2942 **** --- 2919,2944 ---- symname = "$d"; type = BSF_OBJECT; break; + case MAP_ARM: symname = "$a"; type = BSF_FUNCTION; break; + case MAP_THUMB: 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; *************** arm_elf_change_section (void) *** 2977,2992 **** 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); } #else #define mapping_state(a) --- 2979,2985 ---- if ((flags & SEC_ALLOC) == 0) return; ! mapstate=seg_info (now_seg)->tc_segment_info_data; } #else #define mapping_state(a) *************** s_ltorg (ignored) *** 3108,3113 **** --- 3101,3108 ---- || pool->symbol == NULL || 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. */ *************** s_force_thumb (ignore) *** 3184,3189 **** --- 3179,3185 ---- This is used by gcc/config/arm/lib1funcs.asm for example to compile interworking support functions even if the target processor should not support interworking. */ + if (! thumb_mode) { thumb_mode = 2; *************** arm_cleanup () *** 13817,13822 **** --- 13813,13821 ---- { /* 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); } } Index: config/tc-arm.h =================================================================== RCS file: /cvs/src/src/gas/config/tc-arm.h,v retrieving revision 1.21 diff -p -r1.21 tc-arm.h *** config/tc-arm.h 21 Nov 2003 00:24:40 -0000 1.21 --- config/tc-arm.h 9 Mar 2004 10:59:14 -0000 *************** struct fix; *** 91,99 **** # define TARGET_FORMAT elf32_arm_target_format() extern const char * elf32_arm_target_format PARAMS ((void)); ! # define md_elf_section_change_hook() arm_elf_change_section extern void arm_elf_change_section (void); #endif #define TC_FORCE_RELOCATION(FIX) arm_force_relocation (FIX) extern int arm_force_relocation PARAMS ((struct fix *)); --- 91,111 ---- # define TARGET_FORMAT elf32_arm_target_format() extern const char * elf32_arm_target_format PARAMS ((void)); ! # define md_elf_section_change_hook() arm_elf_change_section() extern void arm_elf_change_section (void); + + enum mstate + { + MAP_UNDEFINED = 0, /* Must be zero, for seginfo in new sections */ + MAP_DATA, + MAP_ARM, + MAP_THUMB + }; + + + #define TC_SEGMENT_INFO_TYPE enum mstate #endif + #define TC_FORCE_RELOCATION(FIX) arm_force_relocation (FIX) extern int arm_force_relocation PARAMS ((struct fix *));