diff options
author | Doug Kwan <dougkwan@google.com> | 2009-06-05 21:32:57 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2009-06-05 21:32:57 +0000 |
commit | bb04269c747a7aa5acffa2355efd1d7343338faf (patch) | |
tree | c0146d3edcbd719434f09eee57c611a592170761 /gold/target.h | |
parent | da1f277114fc1ed98e71bf2fde32fe82757e9314 (diff) | |
download | gdb-bb04269c747a7aa5acffa2355efd1d7343338faf.zip gdb-bb04269c747a7aa5acffa2355efd1d7343338faf.tar.gz gdb-bb04269c747a7aa5acffa2355efd1d7343338faf.tar.bz2 |
2009-06-05 Doug Kwan <dougkwan@google.com>
* Makefile.am (CCFILES): Add target.cc.
* Makefile.in: Regenerate.
* i386.cc (class Target_i386): Define new virtual method to
override do_is_local_label_name in parent.
* object.cc (Sized_relobj::do_count_local_symbols): Discard
local symbols if --discard-locals or -X is given.
* options.h (class General_options): Declare new options
'--discard-locals' and '-X' for discarding locals.
* target.h (class Target): Define new methods is_local_label_name.
Declare new virtual method do_is_local_label_name.
* target.cc: New file.
* testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
(check_SCRIPTS): Add discard_locals_test.sh.
(check_DATA): Add discard_local_tests.syms.
(discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
(discard_local_tests.syms, discard_locals_test.o): New make rules.
* testsuite/Makefile.in: Regenerate.
* testsuite/discard_locals_test.c: New file.
* testsuite/discard_locals_test.sh: Same.
Diffstat (limited to 'gold/target.h')
-rw-r--r-- | gold/target.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gold/target.h b/gold/target.h index fd6766e..2a28105 100644 --- a/gold/target.h +++ b/gold/target.h @@ -173,6 +173,12 @@ class Target adjust_elf_header(unsigned char* view, int len) const { return this->do_adjust_elf_header(view, len); } + // Return whether NAME is a local label name. This is used to implement the + // --discard-locals options. + bool + is_local_label_name(const char* name) const + { return this->do_is_local_label_name(name); } + protected: // This struct holds the constant information for a child class. We // use a struct to avoid the overhead of virtual function calls for @@ -239,6 +245,10 @@ class Target do_adjust_elf_header(unsigned char*, int) const { } + // Virtual function which may be overriden by the child class. + virtual bool + do_is_local_label_name(const char*) const; + private: Target(const Target&); Target& operator=(const Target&); |