summaryrefslogtreecommitdiff
path: root/bfd/elf32-vax.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2009-06-16 01:52:13 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2009-06-16 01:52:13 +0000
commit0fbdade20dad563d0a4462326b54b3f6a777c9a6 (patch)
tree37ae8e2b23dda8c890fbe46ba73ebe50341db9d1 /bfd/elf32-vax.c
parent2da97eee61466cd4b39e8dc8d6c3a196e8055e2c (diff)
downloadbinutils-redhat-0fbdade20dad563d0a4462326b54b3f6a777c9a6.tar.gz
bfd/
* elf32-vax.c (elf_vax_check_relocs): Handle the visibility attribute. (elf_vax_relocate_section): Likewise. gas/ * config/tc-vax.c (md_estimate_size_before_relax): Accept indirect symbol references in the PIC mode and emit a PC-relative relocation instead of a GOT/PLT one. Likewise for symbols known to be hidden at this point.
Diffstat (limited to 'bfd/elf32-vax.c')
-rw-r--r--bfd/elf32-vax.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 9caa47d19a..93cb1cb09c 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -605,6 +605,11 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
|| h == elf_hash_table (info)->hplt)
break;
+ /* If this is a local symbol, we resolve it directly without
+ creating a global offset table entry. */
+ if (h == NULL || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
+ break;
+
/* This symbol requires a global offset table entry. */
if (dynobj == NULL)
@@ -677,7 +682,7 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
/* If this is a local symbol, we resolve it directly without
creating a procedure linkage table entry. */
BFD_ASSERT (h != NULL);
- if (h->forced_local)
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT || h->forced_local)
break;
h->needs_plt = 1;
@@ -706,7 +711,9 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
&& (!info->symbolic
|| !h->def_regular)))
{
- if (h != NULL && !h->forced_local)
+ if (h != NULL
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && !h->forced_local)
{
/* Make sure a plt entry is created for this symbol if
it turns out to be a function defined by a dynamic
@@ -718,14 +725,17 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
}
break;
}
- if (h != NULL && h->forced_local)
+ /* If this is a local symbol, we can resolve it directly. */
+ if (h != NULL
+ && (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ || h->forced_local))
break;
/* Fall through. */
case R_VAX_8:
case R_VAX_16:
case R_VAX_32:
- if (h != NULL)
+ if (h != NULL && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
{
/* Make sure a plt entry is created for this symbol if it
turns out to be a function defined by a dynamic object. */
@@ -1465,7 +1475,10 @@ elf_vax_relocate_section (bfd *output_bfd,
case R_VAX_GOT32:
/* Relocation is to the address of the entry for this symbol
in the global offset table. */
- if (h == NULL || h->got.offset == (bfd_vma) -1 || h->forced_local)
+ if (h == NULL
+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ || h->got.offset == (bfd_vma) -1
+ || h->forced_local)
break;
/* Relocation is the offset of the entry for this symbol in
@@ -1527,7 +1540,9 @@ elf_vax_relocate_section (bfd *output_bfd,
/* Resolve a PLTxx reloc against a local symbol directly,
without using the procedure linkage table. */
- if (h == NULL || h->forced_local)
+ if (h == NULL
+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ || h->forced_local)
break;
if (h->plt.offset == (bfd_vma) -1
@@ -1581,7 +1596,9 @@ elf_vax_relocate_section (bfd *output_bfd,
case R_VAX_PC8:
case R_VAX_PC16:
case R_VAX_PC32:
- if (h == NULL || h->forced_local)
+ if (h == NULL
+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ || h->forced_local)
break;
/* Fall through. */
case R_VAX_8: