diff options
author | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:34:24 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:34:24 +0000 |
commit | 2e13b764859730a6bf359cd73b7e7acd4d95e071 (patch) | |
tree | c25da3c0c3ee5c438aeeae100b149e1598232980 /gas/config/obj-elf.c | |
parent | 7a13edea08cb46d90e1512c72540de7d0b1411a5 (diff) | |
download | gdb-2e13b764859730a6bf359cd73b7e7acd4d95e071.zip gdb-2e13b764859730a6bf359cd73b7e7acd4d95e071.tar.gz gdb-2e13b764859730a6bf359cd73b7e7acd4d95e071.tar.bz2 |
ELF visibility patch from Martin Loewis
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r-- | gas/config/obj-elf.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 29402eb..4fbd8bc 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -65,6 +65,7 @@ static void obj_elf_type PARAMS ((int)); static void obj_elf_ident PARAMS ((int)); static void obj_elf_weak PARAMS ((int)); static void obj_elf_local PARAMS ((int)); +static void obj_elf_visibility PARAMS ((int)); static void obj_elf_symver PARAMS ((int)); static void obj_elf_vtable_inherit PARAMS ((int)); static void obj_elf_vtable_entry PARAMS ((int)); @@ -89,6 +90,11 @@ static const pseudo_typeS elf_pseudo_table[] = {"version", obj_elf_version, 0}, {"weak", obj_elf_weak, 0}, + /* These define symbol visibility. */ + {"internal", obj_elf_visibility, STV_INTERNAL}, + {"hidden", obj_elf_visibility, STV_HIDDEN}, + {"protected", obj_elf_visibility, STV_PROTECTED}, + /* These are used for stabs-in-elf configurations. */ {"line", obj_elf_line, 0}, @@ -474,6 +480,48 @@ obj_elf_weak (ignore) demand_empty_rest_of_line (); } +static void +obj_elf_visibility (visibility) + int visibility; +{ + char *name; + int c; + symbolS *symbolP; + asymbol *bfdsym; + elf_symbol_type *elfsym; + + do + { + name = input_line_pointer; + c = get_symbol_end (); + symbolP = symbol_find_or_make (name); + *input_line_pointer = c; + + SKIP_WHITESPACE (); + + bfdsym = symbol_get_bfdsym (symbolP); + elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym); + + assert (elfsym); + + elfsym->internal_elf_sym.st_other = visibility; + + if (c == ',') + { + input_line_pointer ++; + + SKIP_WHITESPACE (); + + if (*input_line_pointer == '\n') + c = '\n'; + } + } + while (c == ','); + + demand_empty_rest_of_line (); +} + + static segT previous_section; static int previous_subsection; |