Implement a new BFD API function: bfd_is_target_special_symbol. Use this in nm
authorNick Clifton <nickc@redhat.com>
Fri, 8 Oct 2004 14:54:04 +0000 (14:54 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 8 Oct 2004 14:54:04 +0000 (14:54 +0000)
and objdump to skip the displaying of ARM Mapping symbols unless specifically
requested.

36 files changed:
bfd/ChangeLog
bfd/aout-target.h
bfd/aout-tic30.c
bfd/bfd-in2.h
bfd/binary.c
bfd/coffcode.h
bfd/configure
bfd/configure.in
bfd/elf32-arm.h
bfd/elfxx-target.h
bfd/i386msdos.c
bfd/ieee.c
bfd/ihex.c
bfd/libaout.h
bfd/libbfd-in.h
bfd/libbfd.h
bfd/libecoff.h
bfd/mach-o.c
bfd/mmo.c
bfd/nlm-target.h
bfd/oasys.c
bfd/pef.c
bfd/ppcboot.c
bfd/srec.c
bfd/syms.c
bfd/targets.c
bfd/tekhex.c
bfd/versados.c
bfd/vms.c
bfd/xcoff-target.h
bfd/xsym.c
binutils/ChangeLog
binutils/NEWS
binutils/doc/binutils.texi
binutils/nm.c
binutils/objdump.c

index 9f24c81a9494444f7aa590a4d5cd8507c4c30537..a0d5663098535dc9a493aa4a5344de69d89a2155 100644 (file)
@@ -1,3 +1,41 @@
+2004-10-08  Nick Clifton  <nickc@redhat.com>
+
+       * configure.in: (AM_INIT_AUTOMAKE): Set version to 2.15.93.
+       * configure: Regenerate.
+       * bfd-in2.h: Regenerate.
+       * syms.c (bfd_is_target_special_symbol): New interface function.
+       Returns true when a symbol should be considered to be special.
+       * targets.h (bfd_target): Include bfd_is_target_special_symbol in
+       the symbol jump table.
+       * elf32-arm.h (elf32_arm_is_target_special_symbol): New function.
+       Return true iff the symbol is a mapping symbol.
+       (bfd_elf32_bfd_is_target_special_symbol): Define.
+       * elfxx-target.h: Provide a default definition for
+       bfd_is_target_special_symbol.
+       * aout-target.h: Likewise.
+       * aout-tic30.c: Likewise.
+       * binary.c: LIkewise.
+       * coffcode.h: Likewise.
+       * i386msdos.c: Likewise.
+       * ieee.c: Likewise.
+       * ihex.c: LIkewise.
+       * libaout.h: Likewise.
+       * libbfd-in.h: Likewise
+       * libecoff.h: Likewise.
+       * mach-o.c: Likewise.
+       * mmo.c: Likewise.
+       * nlm-target.h: Likewise.
+       * oasys.c: Likewise.
+       * pef.c: Likewise.
+       * ppcboot.c: Likewise.
+       * srec.c: Likewise.
+       * tekhex.c: Likewise.
+       * versados.c: Likewise.
+       * vms.c: Likewise.
+       * xcoff-target.h: Likewise.
+       * xsym.c: Likewise.
+       * libbfd.h: Regenerate.
+
 2004-10-08  Daniel Jacobowitz  <dan@debian.org>
 
        * config.bfd: Include 64-bit support for i[3-7]86-*-solaris2*.
index a1697043550357365d9d785daa5c015e63fffab1..913339f39d9d057274f5cbc9e52bb019d6ce379b 100644 (file)
@@ -579,6 +579,10 @@ MY_bfd_final_link (abfd, info)
 #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
+#ifndef MY_bfd_is_target_special_symbol
+#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#endif
+
 #ifndef MY_bfd_free_cached_info
 #define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
 #endif
index a9c06ff3b4e9e0c4d31110c6334e900f2b217254..850c5589d5cc6a24524eafab4194da53fd7417ad 100644 (file)
@@ -1036,6 +1036,11 @@ tic30_aout_set_arch_mach (abfd, arch, machine)
 #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
+#ifndef MY_bfd_is_target_special_symbol
+#define MY_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#endif
+
 #ifndef MY_bfd_free_cached_info
 #define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
 #endif
index 2e851a9d950a7eb8ed9b475bc31218adb69c8d37..2e137043d6bcf077264a7416157f913708eb0aed 100644 (file)
@@ -3828,6 +3828,11 @@ bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
 #define bfd_is_local_label_name(abfd, name) \
   BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
 
+bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+
+#define bfd_is_target_special_symbol(abfd, sym) \
+  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+
 #define bfd_canonicalize_symtab(abfd, location) \
   BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
 
@@ -4443,6 +4448,7 @@ typedef struct bfd_target
   NAME##_print_symbol, \
   NAME##_get_symbol_info, \
   NAME##_bfd_is_local_label_name, \
+  NAME##_bfd_is_target_special_symbol, \
   NAME##_get_lineno, \
   NAME##_find_nearest_line, \
   NAME##_bfd_make_debug_symbol, \
@@ -4461,7 +4467,7 @@ typedef struct bfd_target
     (bfd *, struct bfd_symbol *, symbol_info *);
 #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
   bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
-
+  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
   alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
   bfd_boolean (*_bfd_find_nearest_line)
     (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
index 4335a28ed3b2a7fb03d0942318409816883b8449..45286726c0a2712cf0db1355a598c0220e140e81 100644 (file)
@@ -234,6 +234,7 @@ binary_get_symbol_info (ignore_abfd, symbol, ret)
   bfd_symbol_info (symbol, ret);
 }
 
+#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define binary_get_lineno _bfd_nosymbols_get_lineno
 #define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
index 51d00c63e0378759ab2f7c0362d5f0d5492ebfe2..9d78c25257efce5bcdb3f02b315c9ed460ac1f6a 100644 (file)
@@ -5547,6 +5547,10 @@ static const bfd_coff_backend_data ticoff1_swap_table =
 #define coff_bfd_is_local_label_name       _bfd_coff_is_local_label_name
 #endif
 
+#ifndef coff_bfd_is_target_special_symbol
+#define coff_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#endif
+
 #ifndef coff_read_minisymbols
 #define coff_read_minisymbols              _bfd_generic_read_minisymbols
 #endif
index 6710ec63e76fd60e2071893889b3ef941eebd8f9..f249bb25c3c74b2db2297360a50714ddd54b356b 100755 (executable)
@@ -2834,7 +2834,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=bfd
- VERSION=2.15.92
+ VERSION=2.15.93
 
 
 cat >>confdefs.h <<_ACEOF
index c5fe78e8a5910ae59ee0d026f2d93abe3281e6cb..cc8afcfc6faa52416dd4cf0d65edc1ae1e2ebf1a 100644 (file)
@@ -8,7 +8,7 @@ AC_CONFIG_SRCDIR([libbfd.c])
 AC_CANONICAL_TARGET
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.15.92)
+AM_INIT_AUTOMAKE(bfd, 2.15.93)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
index be6391c47a2d09f4160ba8ed42cee50a64b5bc5a..a0695c1afc344d2ea32c82fe5c86485c2f383e84 100644 (file)
@@ -25,7 +25,7 @@
 typedef unsigned long int insn32;
 typedef unsigned short int insn16;
 
-/* In leiu of proper flags, assume all EABIv3 objects are interworkable.  */
+/* In lieu of proper flags, assume all EABIv3 objects are interworkable.  */
 #define INTERWORK_FLAG(abfd)  \
   (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) == EF_ARM_EABI_VER3 \
   || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK))
@@ -2328,6 +2328,7 @@ elf32_arm_object_p (bfd *abfd)
 }
 
 /* Function to keep ARM specific flags in the ELF header.  */
+
 static bfd_boolean
 elf32_arm_set_private_flags (bfd *abfd, flagword flags)
 {
@@ -3163,6 +3164,14 @@ is_arm_mapping_symbol_name (const char * name)
     && (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);
+}
+
 /* This is a copy of elf_find_function() from elf.c except that
    ARM mapping symbols are ignored when looking for function names
    and STT_ARM_TFUNC is considered to a function type.  */
@@ -4462,6 +4471,7 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec,
 #define bfd_elf32_bfd_reloc_type_lookup                elf32_arm_reloc_type_lookup
 #define bfd_elf32_find_nearest_line            elf32_arm_find_nearest_line
 #define bfd_elf32_new_section_hook             elf32_arm_new_section_hook
+#define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol
 
 #define elf_backend_get_symbol_type             elf32_arm_get_symbol_type
 #define elf_backend_gc_mark_hook                elf32_arm_gc_mark_hook
index 18a8d0f5d6955b38e50ca96b53a7c1d58a3fa33f..81202f8cdeb5ea6ecda05365fab58fec5e0832f3 100644 (file)
 #ifndef bfd_elfNN_bfd_is_local_label_name
 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
 #endif
+#ifndef bfd_elfNN_bfd_is_target_special_symbol
+#define bfd_elfNN_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#endif
 
 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
 #define bfd_elfNN_get_dynamic_reloc_upper_bound \
index aedcef0fcb5bb57518bbbd35f7a6261f829f9d0b..a1a7baa13e796573bdb67e78ede6f570ee25c172 100644 (file)
@@ -193,6 +193,7 @@ msdos_set_section_contents (abfd, section, location, offset, count)
 #define msdos_get_symbol_info _bfd_nosymbols_get_symbol_info
 #define msdos_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define msdos_get_lineno _bfd_nosymbols_get_lineno
+#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols
index aaf1f1124b258f66558e94213d3da3fd5e8b5bf1..c16a1ed15900f77b0ad0ea3986ce41ef4a05f5ec 100644 (file)
@@ -4018,6 +4018,8 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 #define ieee_update_armap_timestamp bfd_true
 #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
 
+#define ieee_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ieee_get_lineno _bfd_nosymbols_get_lineno
 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index 1392178fee27c24fe6c81e88355a7bad366176e6..c692b03b33abff2f4acd20d1def073a30d34d0b1 100644 (file)
@@ -968,6 +968,7 @@ ihex_sizeof_headers (abfd, exec)
 #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
 #define ihex_print_symbol _bfd_nosymbols_print_symbol
 #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
+#define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define ihex_get_lineno _bfd_nosymbols_get_lineno
 #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
index a76289548895ca8a044cc139cec5006cf3dc2070..ef9eae1a9d9d32832b3acdff925c315cceed7143 100644 (file)
@@ -606,6 +606,11 @@ extern bfd_boolean NAME(aout,bfd_free_cached_info)
 #define aout_32_bfd_is_local_label_name bfd_generic_is_local_label_name
 #endif
 
+#ifndef aout_32_bfd_is_target_special_symbol
+#define aout_32_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#endif
+
 #ifndef WRITE_HEADERS
 #define WRITE_HEADERS(abfd, execp)                                           \
       {                                                                              \
index 7b6ca76e05a4429afaba2b78fd457306e783cba2..95399dcee27217654056deec09d87cf369cfb411 100644 (file)
@@ -299,6 +299,8 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
   ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
 #define _bfd_nosymbols_bfd_is_local_label_name \
   ((bfd_boolean (*) (bfd *, const char *)) bfd_false)
+#define _bfd_nosymbols_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
   ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
index c811de5be733d670ed49002fee9920d4f1642dc1..81f03c96b0434b1e0346d0c8631ff09c2c89cc6f 100644 (file)
@@ -304,6 +304,8 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table
   ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void)
 #define _bfd_nosymbols_bfd_is_local_label_name \
   ((bfd_boolean (*) (bfd *, const char *)) bfd_false)
+#define _bfd_nosymbols_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
   ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
index b809f3a06618fcadc66257f68bbc737efba2a9ab..495be6363851e9596d6c52d49e1887d994a92c67 100644 (file)
@@ -272,6 +272,8 @@ extern bfd_boolean _bfd_ecoff_write_armap
 #define _bfd_ecoff_get_elt_at_index _bfd_generic_get_elt_at_index
 #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
 #define _bfd_ecoff_update_armap_timestamp bfd_true
+#define _bfd_ecoff_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 
 extern long _bfd_ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd));
 extern long _bfd_ecoff_canonicalize_symtab PARAMS ((bfd *abfd, asymbol **alocation));
index c4c05ab84d8b05ddb7f345a67f7a7502e8ed7533..19a19d4d0f698cfecfeaa320c117dfd5de56db32 100644 (file)
@@ -44,6 +44,8 @@
 #define bfd_mach_o_new_section_hook _bfd_generic_new_section_hook
 #define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
 #define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define bfd_mach_o_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno
 #define bfd_mach_o_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index 1b7eb86a4eebdaf7e058b3b8aeda833ef1550a73..a7745c1711583687482b0b9cb01d783072d45ec2 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -3255,6 +3255,8 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols)
 /* Perhaps we need to adjust this one; mmo labels (originally) without a
    leading ':' might more appropriately be called local.  */
 #define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define mmo_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 
 /* Is this one really used or defined by anyone?  */
 #define mmo_get_lineno _bfd_nosymbols_get_lineno
index 30ae4b101f7e8c66c9c52b99e48c305bafaf270a..1c727ed5ca54aa6404e88f8f9895c26c47efc71f 100644 (file)
@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define nlm_print_symbol nlmNAME(print_symbol)
 #define nlm_get_symbol_info nlmNAME(get_symbol_info)
 #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define nlm_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define nlm_get_lineno _bfd_nosymbols_get_lineno
 #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index c99919af0a966673de7a2fe8f769914cd0aa954f..16f6b6d5adff0e3675bc95c8f733338a50b1fbf7 100644 (file)
@@ -1489,6 +1489,7 @@ oasys_sizeof_headers (abfd, exec)
 #define oasys_update_armap_timestamp bfd_true
 
 #define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define oasys_get_lineno _bfd_nosymbols_get_lineno
 #define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define oasys_read_minisymbols _bfd_generic_read_minisymbols
index b52ae65a0a120627e27a59c3915688f0e98ea8b4..9bb3a76f155213171168289ddcb5682dc5a9ce32 100644 (file)
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -37,6 +37,7 @@
 #define bfd_pef_bfd_free_cached_info                _bfd_generic_bfd_free_cached_info
 #define bfd_pef_new_section_hook                    _bfd_generic_new_section_hook
 #define bfd_pef_bfd_is_local_label_name             bfd_generic_is_local_label_name
+#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define bfd_pef_get_lineno                          _bfd_nosymbols_get_lineno
 #define bfd_pef_find_nearest_line                   _bfd_nosymbols_find_nearest_line
 #define bfd_pef_bfd_make_debug_symbol               _bfd_nosymbols_bfd_make_debug_symbol
index 49f81402149e72f8551ee5187fdd0fb2ab0e4c55..3444caa8be7b8c1b03a3417037fc12a259d309cf 100644 (file)
@@ -345,6 +345,8 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret)
   bfd_symbol_info (symbol, ret);
 }
 
+#define ppcboot_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ppcboot_get_lineno _bfd_nosymbols_get_lineno
 #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
index 19dfaa9fd836e1b0abfe4ad3583073638e005de8..e184a20eaa3b3e01e44ededcf6b08080c9685c33 100644 (file)
@@ -1262,6 +1262,7 @@ srec_print_symbol (abfd, afile, symbol, how)
 #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define srec_new_section_hook _bfd_generic_new_section_hook
 
+#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define srec_get_lineno _bfd_nosymbols_get_lineno
 #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
index e78f5ec7be7ea221e669fe1e19b69523b7b3aacd..245369d20d770e6ce610e9309423d1e847a31fbb 100644 (file)
@@ -380,6 +380,23 @@ DESCRIPTION
 .
 */
 
+/*
+FUNCTION
+       bfd_is_target_special_symbol
+
+SYNOPSIS
+        bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+
+DESCRIPTION
+       Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
+       special to the particular target represented by the BFD.  Such symbols
+       should normally not be mentioned to the user.
+
+.#define bfd_is_target_special_symbol(abfd, sym) \
+.  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+.
+*/
+
 /*
 FUNCTION
        bfd_canonicalize_symtab
index 05832d82abd4efc8a03388e01de8aa5b0ae8aa18..6b5c00cf28b2b3e796bee97d5a692608f378df7e 100644 (file)
@@ -338,6 +338,7 @@ BFD_JUMP_TABLE macros.
 .  NAME##_print_symbol, \
 .  NAME##_get_symbol_info, \
 .  NAME##_bfd_is_local_label_name, \
+.  NAME##_bfd_is_target_special_symbol, \
 .  NAME##_get_lineno, \
 .  NAME##_find_nearest_line, \
 .  NAME##_bfd_make_debug_symbol, \
@@ -356,7 +357,7 @@ BFD_JUMP_TABLE macros.
 .    (bfd *, struct bfd_symbol *, symbol_info *);
 .#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
 .  bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
-.
+.  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
 .  alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
 .  bfd_boolean (*_bfd_find_nearest_line)
 .    (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
index a7a925470fcb6d9110a8ac6a0e81aa14b2405c3f..df1dab5f125faf80e14d7a2786e77d5ac832d079 100644 (file)
@@ -989,6 +989,7 @@ tekhex_print_symbol (abfd, filep, symbol, how)
 #define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define tekhex_new_section_hook _bfd_generic_new_section_hook
 
+#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define tekhex_get_lineno _bfd_nosymbols_get_lineno
 #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
index 50b3487fbcd4a2dbfc90bfad5e9c82e89660f102..68678c860da83134a6397155777e46506b01c6c0 100644 (file)
@@ -855,6 +855,8 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols)
 #define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define versados_new_section_hook _bfd_generic_new_section_hook
 
+#define versados_bfd_is_target_special_symbol \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define versados_get_lineno _bfd_nosymbols_get_lineno
 #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
index 640d0eb6c98d59d3561762976e3f8525daa5e416..15ab5b08ce48d37491a11d9d696ce841930c9985 100644 (file)
--- a/bfd/vms.c
+++ b/bfd/vms.c
@@ -164,6 +164,7 @@ static bfd_boolean vms_bfd_merge_private_bfd_data
 static bfd_boolean vms_bfd_set_private_flags
   PARAMS ((bfd *abfd, flagword flags));
 
+#define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define vms_make_empty_symbol _bfd_generic_make_empty_symbol
 #define vms_bfd_link_just_syms _bfd_generic_link_just_syms
 #define vms_bfd_is_group_section bfd_generic_is_group_section
index 9b80e3c5ac29ce9b28e6d01e737b92bf6be35b59..78de54ac89cf0422baa8e91e5bd37cc324aae9d4 100644 (file)
@@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define coff_mkobject _bfd_xcoff_mkobject
 #define coff_bfd_copy_private_bfd_data _bfd_xcoff_copy_private_bfd_data
 #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name
+#define coff_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup
 #define coff_relocate_section _bfd_ppc_xcoff_relocate_section
 
index 3c4c84da9adc34eef30e22b213c7491b2ad3b9b9..252be999d56c12039e76fba650d29d2e7ab6dc1e 100644 (file)
@@ -27,6 +27,7 @@
 #define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 #define bfd_sym_new_section_hook _bfd_generic_new_section_hook
 #define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
 #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
index 12196c66c328b5a9843f1367341da3a9f035e357..ab1c85741d696542a0a2f6392ee7341573f59600 100644 (file)
@@ -1,3 +1,15 @@
+2004-10-08  Nick Clifton  <nickc@redhat.com>
+
+       * nm.c: Add a new switch --special-syms which, if enabled, will
+       include the ARM Mapping symbols in nm's output.
+       (usage): Mention the switch.
+       (filter_symbols): Handle the switch.
+       * objdump.c: Add a similar switch.
+       (usage): Mention the switch.
+       (dump_symbols): Handle the switch.
+       * doc/binutils.texi: Document the new switches.
+       * NEWS: Mention the new switches.
+
 2004-10-08  Daniel Jacobowitz  <dan@debian.org>
 
        * readelf.c (get_x86_64_section_type_name): New function.
index a753312c57ab367bdd25ccd27dcb5fb60abab29d..f7c2dd7510ce2a8aa6802c4b9233858f4fcfbe33 100644 (file)
@@ -1,5 +1,11 @@
 -*- text -*-
 
+* nm and objdump now have a switch "--special-syms" to enable the displaying of
+  symbols which the target considers to be special.  By default these symbols
+  are no longer displayed.  Currently the only special symbols are the Mapping
+  symbols used by the ARM port to mark transitions between text and data and
+  between ARM and THUMB code.
+
 * dlltool has a switch "--ext-prefix-alias <prefix>" to generate additional
   import and export symbols with <preifx> prepended to them.
 
index 0a80a0d96ececf640c608008bb89194e77bc02d7..97a6538ddf5eb576e72d390e16edccda9e48f7c3 100644 (file)
@@ -663,7 +663,7 @@ The @sc{gnu} linker @command{ld} is now described in a separate manual.
 nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}]
    [@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}]
    [@option{-S}|@option{--print-size}] [@option{-s}|@option{--print-armap}]
-   [@option{-A}|@option{-o}|@option{--print-file-name}]
+   [@option{-A}|@option{-o}|@option{--print-file-name}][@option{--special-syms}]
    [@option{-n}|@option{-v}|@option{--numeric-sort}] [@option{-p}|@option{--no-sort}]
    [@option{-r}|@option{--reverse-sort}] [@option{--size-sort}] [@option{-u}|@option{--undefined-only}]
    [@option{-t} @var{radix}|@option{--radix=}@var{radix}] [@option{-P}|@option{--portability}]
@@ -879,6 +879,14 @@ value.  If the @code{bsd} output format is used the size of the symbol
 is printed, rather than the value, and @samp{-S} must be used in order 
 both size and value to be printed.
 
+@item --special-syms
+Display symbols which have a target-specific special meaning.  These
+symbols are usually used by the target for some special processing and
+are not normally helpful when included included in the normal symbol
+lists.  For example for ARM targets this option would skip the mapping
+symbols used to mark transistions between ARM code, THUMB code and
+data.
+
 @item -t @var{radix}
 @itemx --radix=@var{radix}
 Use @var{radix} as the radix for printing the symbol values.  It must be
@@ -1495,6 +1503,7 @@ objdump [@option{-a}|@option{--archive-headers}]
         [@option{--prefix-addresses}]
         [@option{--[no-]show-raw-insn}]
         [@option{--adjust-vma=}@var{offset}]
+        [@option{--special-syms}]
         [@option{-V}|@option{--version}]
         [@option{-H}|@option{--help}]
         @var{objfile}@dots{}
@@ -1837,6 +1846,11 @@ meaningful for dynamic objects, such as certain types of shared
 libraries.  This is similar to the information provided by the @samp{nm}
 program when given the @option{-D} (@option{--dynamic}) option.
 
+@item --special-syms
+When displaying symbols include those which the target considers to be
+special in some way and which would not normally be of interest to the
+user.
+
 @item -V
 @itemx --version
 Print the version number of @command{objdump} and exit.
index be89cec8bd1cba67e99ae62ad98b53232aecf202..c35f7c881552ea98493633017b55de39e92fd211 100644 (file)
@@ -152,6 +152,7 @@ static int show_version = 0;        /* Show the version number.  */
 static int show_stats = 0;     /* Show statistics.  */
 static int show_synthetic = 0; /* Display synthesized symbols too.  */
 static int line_numbers = 0;   /* Print line numbers for symbols.  */
+static int allow_special_symbols = 0;  /* Allow special symbols.  */
 
 /* When to print the names of files.  Not mutually exclusive in SYSV format.  */
 static int filename_per_file = 0;      /* Once per file, on its own line.  */
@@ -205,6 +206,7 @@ static struct option long_options[] =
   {"radix", required_argument, 0, 't'},
   {"reverse-sort", no_argument, &reverse_sort, 1},
   {"size-sort", no_argument, &sort_by_size, 1},
+  {"special-syms", no_argument, &allow_special_symbols, 1},
   {"stats", no_argument, &show_stats, 1},
   {"synthetic", no_argument, &show_synthetic, 1},
   {"target", required_argument, 0, OPTION_TARGET},
@@ -246,6 +248,7 @@ usage (FILE *stream, int status)
   -S, --print-size       Print size of defined symbols\n\
   -s, --print-armap      Include index for symbols from archive members\n\
       --size-sort        Sort symbols by size\n\
+      --skip-special     Ignore special symbols\n\
       --synthetic        Display synthetic symbols as well\n\
   -t, --radix=RADIX      Use RADIX for printing symbol values\n\
       --target=BFDNAME   Specify the target object format as BFDNAME\n\
@@ -446,6 +449,11 @@ filter_symbols (bfd *abfd, bfd_boolean dynamic, void *minisyms,
            keep = 0;
        }
 
+      if (keep
+         && bfd_is_target_special_symbol (abfd, sym)
+         && ! allow_special_symbols)
+       keep = 0;
+
       if (keep)
        {
          memcpy (to, from, size);
index e56bf36db20401427ed95408b2f4d61386805121..73af4298ea4eef54731e116cd09c61ecf93afa17 100644 (file)
@@ -102,6 +102,7 @@ static bfd_vma start_address = (bfd_vma) -1; /* --start-address */
 static bfd_vma stop_address = (bfd_vma) -1;  /* --stop-address */
 static int dump_debugging;             /* --debugging */
 static int dump_debugging_tags;                /* --debugging-tags */
+static int dump_special_syms = 0;      /* --special-syms */
 static bfd_vma adjust_section_vma = 0; /* --adjust-vma */
 static int file_start_context = 0;      /* --file-start-context */
 
@@ -217,6 +218,7 @@ usage (FILE *stream, int status)
       --prefix-addresses         Print complete address alongside disassembly\n\
       --[no-]show-raw-insn       Display hex alongside symbolic disassembly\n\
       --adjust-vma=OFFSET        Add OFFSET to all displayed section addresses\n\
+      --special-syms             Include special symbols in symbol dumps\n\
 \n"));
       list_supported_targets (program_name, stream);
       list_supported_architectures (program_name, stream);
@@ -268,6 +270,7 @@ static struct option long_options[]=
   {"section-headers", no_argument, NULL, 'h'},
   {"show-raw-insn", no_argument, &show_raw_insn, 1},
   {"source", no_argument, NULL, 'S'},
+  {"special-syms", no_argument, &dump_special_syms, 1},
   {"include", required_argument, NULL, 'I'},
   {"stabs", no_argument, NULL, 'G'},
   {"start-address", required_argument, NULL, OPTION_START_ADDRESS},
@@ -2283,6 +2286,10 @@ dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic)
        printf (_("could not determine the type of the %ld'th symbol"),
                count);
 
+      else if (! dump_special_syms
+              && bfd_is_target_special_symbol (cur_bfd, *current))
+       continue;
+
       else
        {
          const char *name = (*current)->name;