diff options
author | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:32:21 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:32:21 +0000 |
commit | 7a13edea08cb46d90e1512c72540de7d0b1411a5 (patch) | |
tree | 6f4fcb7c2b1f1caa3527b12b4dca91e483bed78a /bfd/elflink.h | |
parent | ea44b73426cc8aa21a6b21eb5a523d53385e42e4 (diff) | |
download | gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.zip gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.tar.gz gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.tar.bz2 |
ELF visibility patch from Martin Loewis.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index 1cf6be9..f15c693 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -1566,9 +1566,24 @@ elf_link_add_object_symbols (abfd, info) h->type = ELF_ST_TYPE (sym.st_info); } - if (sym.st_other != 0 - && (definition || h->other == 0)) - h->other = sym.st_other; + /* If st_other has a processor-specific meaning, specific code + might be needed here. */ + if (sym.st_other != 0) + { + /* Combine visibilities, using the most constraining one. */ + unsigned char hvis = ELF_ST_VISIBILITY (h->other); + unsigned char symvis = ELF_ST_VISIBILITY (sym.st_other); + + if (symvis && (hvis > symvis || hvis == 0)) + h->other = sym.st_other; + + /* If neither has visibility, use the st_other of the + definition. This is an arbitrary choice, since the + other bits have no general meaning. */ + if (!symvis && !hvis + && (definition || h->other == 0)) + h->other = sym.st_other; + } /* Set a flag in the hash table entry indicating the type of reference or definition we just found. Keep a count of |