aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-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
commit7b6021f1972b04daee9d9afd467be3e1782c2158 (patch)
treef77665f0443fa451e57df1f6677ab2c69d1fa0f6 /gas/config/tc-vax.c
parentb9f026bcd53ac6ec1171f4699d10e2a6e3a4e0bd (diff)
downloadgdb-7b6021f1972b04daee9d9afd467be3e1782c2158.zip
gdb-7b6021f1972b04daee9d9afd467be3e1782c2158.tar.gz
gdb-7b6021f1972b04daee9d9afd467be3e1782c2158.tar.bz2
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 'gas/config/tc-vax.c')
-rw-r--r--gas/config/tc-vax.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c
index db2055e..ec83657 100644
--- a/gas/config/tc-vax.c
+++ b/gas/config/tc-vax.c
@@ -396,23 +396,20 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
|| S_IS_WEAK (fragP->fr_symbol)
|| S_IS_EXTERNAL (fragP->fr_symbol)))
{
- if (p[0] & 0x10)
- {
- if (flag_want_pic)
- as_fatal ("PIC reference to %s is indirect.\n",
- S_GET_NAME (fragP->fr_symbol));
- }
+ /* Indirect references cannot go through the GOT or PLT,
+ let's hope they'll become local in the final link. */
+ if ((ELF_ST_VISIBILITY (S_GET_OTHER (fragP->fr_symbol))
+ != STV_DEFAULT)
+ || (p[0] & 0x10))
+ reloc_type = BFD_RELOC_32_PCREL;
+ else if (((unsigned char *) fragP->fr_opcode)[0] == VAX_CALLS
+ || ((unsigned char *) fragP->fr_opcode)[0] == VAX_CALLG
+ || ((unsigned char *) fragP->fr_opcode)[0] == VAX_JSB
+ || ((unsigned char *) fragP->fr_opcode)[0] == VAX_JMP
+ || S_IS_FUNCTION (fragP->fr_symbol))
+ reloc_type = BFD_RELOC_32_PLT_PCREL;
else
- {
- if (((unsigned char *) fragP->fr_opcode)[0] == VAX_CALLS
- || ((unsigned char *) fragP->fr_opcode)[0] == VAX_CALLG
- || ((unsigned char *) fragP->fr_opcode)[0] == VAX_JSB
- || ((unsigned char *) fragP->fr_opcode)[0] == VAX_JMP
- || S_IS_FUNCTION (fragP->fr_symbol))
- reloc_type = BFD_RELOC_32_PLT_PCREL;
- else
- reloc_type = BFD_RELOC_32_GOT_PCREL;
- }
+ reloc_type = BFD_RELOC_32_GOT_PCREL;
}
#endif
switch (RELAX_STATE (fragP->fr_subtype))