]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* bfd/bfd-in.h (bfd_is_arm_mapping_symbol_name): Add prototype. binutils-csl-arm-2005q1a
authorJulian Brown <julian@codesourcery.com>
Wed, 30 Mar 2005 17:28:28 +0000 (17:28 +0000)
committerJulian Brown <julian@codesourcery.com>
Wed, 30 Mar 2005 17:28:28 +0000 (17:28 +0000)
* bfd/bfd-in2.h: Regenerate.
* bfd/elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
bfd_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_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.

13 files changed:
bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/cpu-arm.c
bfd/elf32-arm.c
gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/mapping.d
ld/testsuite/ChangeLog
ld/testsuite/ld-arm/arm-app-abs32.d
ld/testsuite/ld-arm/arm-app.d
ld/testsuite/ld-arm/mixed-app.d

index b29e7c6bfe25d73d3ce4dc0c7432c5758cf2e8e7..9efe3cf1a9ecef0111382c0d0f7a6442ad856667 100644 (file)
@@ -1,3 +1,16 @@
+2005-03-30  Julian Brown  <julian@codesourcery.com>
+
+       * bfd-in.h (bfd_is_arm_mapping_symbol_name): Add prototype.
+       * bfd-in2.h: Regenerate.
+       * elf32-arm.c (elf32_arm_is_target_special_symbol): Rename call to
+       bfd_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...
+       * cpu-arm.c (bfd_is_arm_mapping_symbol_name): ...to here, renamed and
+       made global.
+
 2005-03-22  Bob Wilson  <bob.wilson@acm.org>
 
        * xtensa-isa.c (xtensa_opcode_lookup, xtensa_state_lookup,
index 37c6386632e163389bf6eaa5fded70218745f233..32764d7dfffbb811d86f9f96c666f8952fe1cb29 100644 (file)
@@ -821,6 +821,10 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
 extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
   (bfd *, struct bfd_link_info *);
 
+/* ELF ARM mapping symbol support */
+extern bfd_boolean bfd_is_arm_mapping_symbol_name
+  (const char * name);
+
 /* ARM Note section processing.  */
 extern bfd_boolean bfd_arm_merge_machines
   (bfd *, bfd *);
index ad8909699ca0f85b18e1225ac148a94bb86fffbf..6a80f74d00d1d4a29742ae85ecea81288a7dea0a 100644 (file)
@@ -828,6 +828,10 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
 extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
   (bfd *, struct bfd_link_info *);
 
+/* ELF ARM mapping symbol support */
+extern bfd_boolean bfd_is_arm_mapping_symbol_name
+  (const char * name);
+
 /* ARM Note section processing.  */
 extern bfd_boolean bfd_arm_merge_machines
   (bfd *, bfd *);
index cd7c7a65575d9e230dd5e63c29e70987b876d9bd..8cc52e5ca07a99a3e26d840d5faba829f63c9847 100644 (file)
@@ -400,3 +400,13 @@ bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section)
     free (buffer);
   return bfd_mach_arm_unknown;
 }
+
+bfd_boolean
+bfd_is_arm_mapping_symbol_name (const char * name)
+{
+  return (name != NULL)
+    && (name[0] == '$')
+    && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd'))
+    && (name[2] == 0);
+}
+
index 7a2afe9cbaed3f3256aa2cc883f7239d3444da0e..d2d51345a7663188a9a923f4dcb85811d4cd7a43 100644 (file)
@@ -4719,21 +4719,12 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
   return TRUE;
 }
 
-static bfd_boolean
-is_arm_mapping_symbol_name (const char * name)
-{
-  return (name != NULL)
-    && (name[0] == '$')
-    && ((name[1] == 'a') || (name[1] == 't') || (name[1] == 'd'))
-    && (name[2] == 0);
-}
-
 /* Treat mapping symbols as special target symbols.  */
 
 static bfd_boolean
 elf32_arm_is_target_special_symbol (bfd * abfd ATTRIBUTE_UNUSED, asymbol * sym)
 {
-  return is_arm_mapping_symbol_name (sym->name);
+  return bfd_is_arm_mapping_symbol_name (sym->name);
 }
 
 /* This is a copy of elf_find_function() from elf.c except that
@@ -4768,12 +4759,12 @@ arm_elf_find_function (bfd *         abfd ATTRIBUTE_UNUSED,
          break;
        case STT_FUNC:
        case STT_ARM_TFUNC:
+       case STT_NOTYPE:
          /* Skip $a and $t symbols.  */
          if ((q->symbol.flags & BSF_LOCAL)
-             && is_arm_mapping_symbol_name (q->symbol.name))
+             && bfd_is_arm_mapping_symbol_name (q->symbol.name))
            continue;
          /* Fall through.  */
-       case STT_NOTYPE:
          if (bfd_get_section (&q->symbol) == section
              && q->symbol.value >= low_func
              && q->symbol.value <= offset)
@@ -6098,7 +6089,7 @@ elf32_arm_output_symbol_hook (struct bfd_link_info *info,
     return TRUE;
 
   /* We only want mapping symbols.  */
-  if (! is_arm_mapping_symbol_name (name))
+  if (! bfd_is_arm_mapping_symbol_name (name))
     return TRUE;
 
   mapcount = ++(elf32_arm_section_data (input_sec)->mapcount);
index 5bef95e7b4900a3de174f40ed080716f59675706..949a3ca924203266b90a5e91beeb31ef95d3b431 100644 (file)
@@ -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-29  Julian Brown  <julian@codesourcery.com>
 
        * config/tc-arm.c (marked_pr_dependency): New bitmap, bit N indicates
index 78d126c7493e18d56c8e9c31631b3cda4db85221..298468fd01d5bd630f84436b1b9ce4e8f89500a9 100644 (file)
@@ -1243,78 +1243,9 @@ validate_offset_imm (unsigned int val, int hwse)
 \f
 #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_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
index 68f166783cb41a97310180386c4949e5662e9f07..e307a6d7c4fc4416ceb6d8cab1586f9da178dbc5 100644 (file)
@@ -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-23  Alan Modra  <amodra@bigpond.net.au>
 
        * gas/elf/section5.s: Don't start directives in first column.
index 9a797597898f6970413b8122c5529e57d7473f0f..3a0ac1a55297ba5903f11ff06708bbf516304022 100644 (file)
@@ -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
index 5aa3a95139ef6fd561b023578b7aa2ee3f761fb4..f245c01ddd80b24d3b253a6468aa94c4dd8cb9a6 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-30  Julian Brown  <julian@codesourcery.com>
+
+       * ld-arm/arm-app-abs32.d: Update expected output due to mapping symbols
+       being untyped.
+       * ld-arm/arm-app.d: Likewise.
+       * ld-arm/mixed-app.d: Likewise.
+
 2005-03-24  Mark Mitchell  <mark@codesourcery.com>
 
        * config/default.exp: Do not load libpath.exp if it does not
index f69ed8f9ee54d6c8022a78b21ecea25bc0cc22a4..9a4da22b33f786fc282d5897ccb20b955fe40ce6 100644 (file)
@@ -8,7 +8,7 @@ Disassembly of section .plt:
 
 .* <.plt>:
     .*:        e52de004        str     lr, \[sp, #-4\]!
-    .*:        e59fe004        ldr     lr, \[pc, #4\]  ; .* <.plt\+0x10>
+    .*:        e59fe004        ldr     lr, \[pc, #4\]  ; .* <_start-0x10>
     .*:        e08fe00e        add     lr, pc, lr
     .*:        e5bef008        ldr     pc, \[lr, #8\]!
     .*:        .*      .*
index 80bed981c70e1cbe42253efc24d0a229b976acc5..207961ea0fa318fcfeb354b0808f786c7f2f5b15 100644 (file)
@@ -8,7 +8,7 @@ Disassembly of section .plt:
 
 .* <.plt>:
  .*:   e52de004        str     lr, \[sp, #-4\]!
- .*:   e59fe004        ldr     lr, \[pc, #4\]  ; .* <.plt\+0x10>
+ .*:   e59fe004        ldr     lr, \[pc, #4\]  ; .* <_start-0x10>
  .*:   e08fe00e        add     lr, pc, lr
  .*:   e5bef008        ldr     pc, \[lr, #8\]!
  .*:   .*
@@ -27,7 +27,7 @@ Disassembly of section .text:
 .* <app_func>:
  .*:   e1a0c00d        mov     ip, sp
  .*:   e92dd800        stmdb   sp!, {fp, ip, lr, pc}
- .*:   ebfffff4        bl      .* <.text-0xc>
+ .*:   ebfffff4        bl      .* <_start-0xc>
  .*:   e89d6800        ldmia   sp, {fp, sp, lr}
  .*:   e12fff1e        bx      lr
 
index 0774f7745c8a3c6b5e9b80cfdef68708e19a10d3..2386bb3c75b93945b016d8094e935b28ba6802b0 100644 (file)
@@ -8,7 +8,7 @@ Disassembly of section .plt:
 
 .* <.plt>:
  .*:   e52de004        str     lr, \[sp, #-4\]!
- .*:   e59fe004        ldr     lr, \[pc, #4\]  ; .* <.plt\+0x10>
+ .*:   e59fe004        ldr     lr, \[pc, #4\]  ; .* <_start-0x2c>
  .*:   e08fe00e        add     lr, pc, lr
  .*:   e5bef008        ldr     pc, \[lr, #8\]!
  .*:   .*
@@ -34,7 +34,7 @@ Disassembly of section .text:
 .* <app_func>:
  .*:   e1a0c00d        mov     ip, sp
  .*:   e92dd800        stmdb   sp!, {fp, ip, lr, pc}
- .*:   ebffffe.        bl      .* <.text-0x..>
+ .*:   ebffffe.        bl      .* <_start-0x..>
  .*:   e89d6800        ldmia   sp, {fp, sp, lr}
  .*:   e12fff1e        bx      lr
  .*:   e1a00000        nop                     \(mov r0,r0\)
@@ -49,7 +49,7 @@ Disassembly of section .text:
 
 .* <app_tfunc>:
  .*:   b500            push    {lr}
- .*:   (ffc.f7ff|f7ffffc.)     bl      .* <.text-0x..>
+ .*:   (ffc.f7ff|f7ffffc.)     bl      .* <_start-0x..>
  .*:   bd00            pop     {pc}
  .*:   4770            bx      lr
  .*:   46c0            nop                     \(mov r8, r8\)