aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-04-22 09:49:03 +0000
committerNick Clifton <nickc@redhat.com>2004-04-22 09:49:03 +0000
commit69b975477d1abc861452d7cb2c82190e44c47a94 (patch)
treea5653cd676ec20a5d46758ccc999bfe0fafed05d /gas/config/tc-arm.c
parent26e75e5c230c6ab93386a0b6827c7a6de0864080 (diff)
downloadgdb-69b975477d1abc861452d7cb2c82190e44c47a94.zip
gdb-69b975477d1abc861452d7cb2c82190e44c47a94.tar.gz
gdb-69b975477d1abc861452d7cb2c82190e44c47a94.tar.bz2
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.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r--gas/config/tc-arm.c32
1 files changed, 13 insertions, 19 deletions
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);
}
}