aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog12
-rw-r--r--binutils/NEWS6
-rw-r--r--binutils/doc/binutils.texi16
-rw-r--r--binutils/nm.c8
-rw-r--r--binutils/objdump.c7
5 files changed, 48 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 12196c6..ab1c857 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/NEWS b/binutils/NEWS
index a753312..f7c2dd7 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -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.
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 0a80a0d..97a6538 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -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.
diff --git a/binutils/nm.c b/binutils/nm.c
index be89cec..c35f7c8 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -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);
diff --git a/binutils/objdump.c b/binutils/objdump.c
index e56bf36..73af429 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -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;