aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2005-03-30 16:22:07 +0000
committerJulian Brown <julian@codesourcery.com>2005-03-30 16:22:07 +0000
commit9d2da7ca8d6d5955d0c72566c490b2dcd091abf9 (patch)
treec076395d1c7df08f955299dd1f0457f8458049da /gas
parent74ec5579b91e2275ecb67a8c91311506f6b8bd32 (diff)
downloadgdb-9d2da7ca8d6d5955d0c72566c490b2dcd091abf9.zip
gdb-9d2da7ca8d6d5955d0c72566c490b2dcd091abf9.tar.gz
gdb-9d2da7ca8d6d5955d0c72566c490b2dcd091abf9.tar.bz2
* bfd/bfd-in.h (bfd_elf32_is_arm_mapping_symbol_name): Add prototype.
* bfd/bfd-in2.h: Regenerate. * bfd/elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to bfd_elf32_is_arm_mapping_symbol_name. (elf32_arm_output_symbol_hook): Likewise. (arm_elf_find_function): Likewise, and include STT_NOTYPE in test for mapping symbols. (is_arm_mapping_symbol_name): Function moved from here... * bfd/cpu-arm.c (bfd_elf32_is_arm_mapping_symbol_name): ...to here, renamed and made global. * gas/config/tc-arm.c (mapping_state): Change documentation in function comment to cross-reference spec instead. Change type of mapping symbols to BSF_NO_TYPE. (arm_adjust_symtab): Don't change type of mapping symbols here. * gas/testsuite/gas/arm/mapping.d: Update expected output. * ld/testsuite/ld-arm/arm-app-abs32.d: Likewise. * ld/testsuite/ld-arm/arm-app.d: Likewise. * ld/testsuite/ld-arm/mixed-app.d: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-arm.c100
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/mapping.d8
4 files changed, 33 insertions, 87 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 789b1a9..e29a646 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2005-03-30 Julian Brown <julian@codesourcery.com>
+
+ * config/tc-arm.c (mapping_state): Change documentation in function
+ comment to cross-reference spec instead. Change type of mapping symbols
+ to BSF_NO_TYPE.
+ (arm_adjust_symtab): Don't change type of mapping symbols here.
+
2005-03-30 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com>
* as.h [NEED_DECLARATION_FFS] (ffs): Prototype and alphabetize.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 78d126c..83b0b21 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -1243,78 +1243,9 @@ validate_offset_imm (unsigned int val, int hwse)
#ifdef OBJ_ELF
/* 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):
-
- 4.4.7 Mapping and tagging symbols
-
- A section of an ARM ELF file can contain a mixture of ARM code,
- Thumb code, and data. There are inline transitions between code
- and data at literal pool boundaries. There can also be inline
- transitions between ARM code and Thumb code, for example in
- ARM-Thumb inter-working veneers. Linkers, machine-level
- debuggers, profiling tools, and disassembly tools need to map
- images accurately. For example, setting an ARM breakpoint on a
- Thumb location, or in a literal pool, can crash the program
- being debugged, ruining the debugging session.
-
- ARM ELF entities are mapped (see section 4.4.7.1 below) and
- tagged (see section 4.4.7.2 below) using local symbols (with
- binding STB_LOCAL). To assist consumers, mapping and tagging
- symbols should be collated first in the symbol table, before
- other symbols with binding STB_LOCAL.
-
- To allow properly collated mapping and tagging symbols to be
- skipped by consumers that have no interest in them, the first
- such symbol should have the name $m and its st_value field equal
- to the total number of mapping and tagging symbols (including
- the $m) in the symbol table.
-
- 4.4.7.1 Mapping symbols
-
- $a Labels the first byte of a sequence of ARM instructions.
- Its type is STT_FUNC.
-
- $d Labels the first byte of a sequence of data items.
- Its type is STT_OBJECT.
-
- $t Labels the first byte of a sequence of Thumb instructions.
- Its type is STT_FUNC.
-
- This list of mapping symbols may be extended in the future.
-
- Section-relative mapping symbols
-
- Mapping symbols defined in a section define a sequence of
- half-open address intervals that cover the address range of the
- section. Each interval starts at the address defined by a
- mapping symbol, and continues up to, but not including, the
- address defined by the next (in address order) mapping symbol or
- the end of the section. A corollary is that there must be a
- mapping symbol defined at the beginning of each section.
- Consumers can ignore the size of a section-relative mapping
- symbol. Producers can set it to 0.
-
- Absolute mapping symbols
-
- Because of the need to crystallize a Thumb address with the
- Thumb-bit set, absolute symbol of type STT_FUNC (symbols of type
- STT_FUNC defined in section SHN_ABS) need to be mapped with $a
- or $t.
-
- The extent of a mapping symbol defined in SHN_ABS is [st_value,
- st_value + st_size), or [st_value, st_value + 1) if st_size = 0,
- where [x, y) denotes the half-open address range from x,
- inclusive, to y, exclusive.
-
- In the absence of a mapping symbol, a consumer can interpret a
- function symbol with an odd value as the Thumb code address
- obtained by clearing the least significant bit of the
- value. This interpretation is deprecated, and it may not work in
- the future.
-
- Note - the Tagging symbols ($b, $f, $p $m) have been dropped from
- the EABI (which is still under development), so they are not
- implemented here. */
+ (See "Mapping symbols", section 4.5.5, ARM AAELF version 1.0).
+ Note that previously, $a and $t has type STT_FUNC (BSF_OBJECT flag),
+ and $d has type STT_OBJECT (BSF_OBJECT flag). Now all three are untyped. */
static enum mstate mapstate = MAP_UNDEFINED;
@@ -1336,15 +1267,15 @@ mapping_state (enum mstate state)
{
case MAP_DATA:
symname = "$d";
- type = BSF_OBJECT;
+ type = BSF_NO_FLAGS;
break;
case MAP_ARM:
symname = "$a";
- type = BSF_FUNCTION;
+ type = BSF_NO_FLAGS;
break;
case MAP_THUMB:
symname = "$t";
- type = BSF_FUNCTION;
+ type = BSF_NO_FLAGS;
break;
case MAP_UNDEFINED:
return;
@@ -13738,14 +13669,17 @@ arm_adjust_symtab (void)
elf_sym = elf_symbol (symbol_get_bfdsym (sym));
bind = ELF_ST_BIND (elf_sym->internal_elf_sym.st_info);
- /* If it's a .thumb_func, declare it as so,
- otherwise tag label as .code 16. */
- if (THUMB_IS_FUNC (sym))
- elf_sym->internal_elf_sym.st_info =
- ELF_ST_INFO (bind, STT_ARM_TFUNC);
- else
- elf_sym->internal_elf_sym.st_info =
- ELF_ST_INFO (bind, STT_ARM_16BIT);
+ if (! bfd_elf32_is_arm_mapping_symbol_name (elf_sym->symbol.name))
+ {
+ /* If it's a .thumb_func, declare it as so,
+ otherwise tag label as .code 16. */
+ if (THUMB_IS_FUNC (sym))
+ elf_sym->internal_elf_sym.st_info =
+ ELF_ST_INFO (bind, STT_ARM_TFUNC);
+ else
+ elf_sym->internal_elf_sym.st_info =
+ ELF_ST_INFO (bind, STT_ARM_16BIT);
+ }
}
}
#endif
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 9a03b9d..2e41c33 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-30 Julian Brown <julian@codesourcery.com>
+
+ * gas/arm/mapping.d: Update expected output due to mapping symbols
+ being untyped.
+
2005-03-29 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/i386.exp: Run segment and inval-seg for i386. Run
diff --git a/gas/testsuite/gas/arm/mapping.d b/gas/testsuite/gas/arm/mapping.d
index 9a79759..3a0ac1a 100644
--- a/gas/testsuite/gas/arm/mapping.d
+++ b/gas/testsuite/gas/arm/mapping.d
@@ -9,10 +9,10 @@ SYMBOL TABLE:
0+00 l d .text 0+0 (|.text)
0+00 l d .data 0+0 (|.data)
0+00 l d .bss 0+0 (|.bss)
-0+00 l F .text 0+0 \$a
-0+08 l F .text 0+0 \$t
-0+00 l O .data 0+0 \$d
+0+00 l .text 0+0 \$a
+0+08 l .text 0+0 \$t
+0+00 l .data 0+0 \$d
0+00 l d foo 0+0 (|foo)
-0+00 l F foo 0+0 \$t
+0+00 l foo 0+0 \$t
0+00 g .text 0+0 mapping
0+08 g F .text 0+0 thumb_mapping