diff options
author | Nick Clifton <nickc@redhat.com> | 2009-07-23 13:00:30 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-07-23 13:00:30 +0000 |
commit | 3e7a7d11f1106a451c26b49fcb8fafb5059fd684 (patch) | |
tree | b3d0c290c25b650e408ec3f60e770f56bb1f5be6 /bfd/syms.c | |
parent | 6ec8e7022b6b6a69ee682d1797e8bfec473aae11 (diff) | |
download | gdb-3e7a7d11f1106a451c26b49fcb8fafb5059fd684.zip gdb-3e7a7d11f1106a451c26b49fcb8fafb5059fd684.tar.gz gdb-3e7a7d11f1106a451c26b49fcb8fafb5059fd684.tar.bz2 |
* config/obj-elf.c (obj_elf_type): Add code to support a type of
gnu_unique_object.
* doc/as.texinfo: Document new feature of .type directive.
* NEWS: Mention support for gnu_unique_object symbol type.
* common.h (STB_GNU_UNIQUE): Define.
* NEWS: Mention the linker's support for symbols with a binding of
STB_GNU_UNIQUE.
* gas/elf/type.s: Add unique global symbol definition.
* gas/elf/type.e: Add expected readelf output for global unique
symbol.
* elfcpp.h (enum STB): Add STB_GNU_UNIQUE.
* readelf.c (get_symbol_binding): For Linux targeted files return
UNIQUE for symbols with the STB_GNU_UNIQUE binding.
* doc/binutils.texi: Document the meaning of the 'u' symbol
binding in the output of nm and objdump --syms.
* elf-bfd.h (struct elf_link_hash_entry): Add unique_global field.
* elf.c (swap_out_syms): Set binding to STB_GNU_UNIQUE for symbols
with the BSF_GNU_UNIQUE flag bit set.
* elfcode.h (elf_slurp_symbol_table): Set the BSF_GNU_UNIQUE flag
for symbols with STB_GNU_UNIQUE binding.
* elflink.c (_bfd_elf_merge_symbol): Set unique_global for symbols
with the STB_GNU_UNIQUE binding.
(elf_link_add_object_symbols): Set the BSF_GNU_UNIQUE flag for
symbols with STB_GNU_UNIQUE binding. Set STB_GNU_UNIQUE for
symbols with the unique_global field set.
(elf_link_output_extsym): Set unique_global field for symbols with
the STB_GNU_UNIQUE binding.
* syms.c (struct bfd_symbol): Define BSF_GNU_UNIQUE flag bit.
(bfd_print_symbol_vandf): Print a 'u' character for BSF_GNU_UNIQUE
symbols.
(bfd_decode_symclass): Return a 'u' character for BSF_GNU_UNIQUE
symbols.
* bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd/syms.c')
-rw-r--r-- | bfd/syms.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -302,6 +302,10 @@ CODE_FRAGMENT . calling the function that it points to. BSF_FUNCTION must . also be also set. *} .#define BSF_GNU_INDIRECT_FUNCTION (1 << 22) +. {* This symbol is a globally unique data object. The dynamic linker +. will make sure that in the entire process there is just one symbol +. with this name and type in use. BSF_OBJECT must also be set. *} +.#define BSF_GNU_UNIQUE (1 << 23) . . flagword flags; . @@ -485,7 +489,8 @@ bfd_print_symbol_vandf (bfd *abfd, void *arg, asymbol *symbol) fprintf (file, " %c%c%c%c%c%c%c", ((type & BSF_LOCAL) ? (type & BSF_GLOBAL) ? '!' : 'l' - : (type & BSF_GLOBAL) ? 'g' : ' '), + : (type & BSF_GLOBAL) ? 'g' + : (type & BSF_GNU_UNIQUE) ? 'u' : ' '), (type & BSF_WEAK) ? 'w' : ' ', (type & BSF_CONSTRUCTOR) ? 'C' : ' ', (type & BSF_WARNING) ? 'W' : ' ', @@ -686,6 +691,8 @@ bfd_decode_symclass (asymbol *symbol) else return 'W'; } + if (symbol->flags & BSF_GNU_UNIQUE) + return 'u'; if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL))) return '?'; |