summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/binutils/bfd')
-rw-r--r--gnu/usr.bin/binutils/bfd/bfd-in2.h1
-rw-r--r--gnu/usr.bin/binutils/bfd/coff-alpha.c28
-rw-r--r--gnu/usr.bin/binutils/bfd/config.bfd8
-rw-r--r--gnu/usr.bin/binutils/bfd/ecoff.c1
-rw-r--r--gnu/usr.bin/binutils/bfd/reloc.c2
5 files changed, 40 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/bfd/bfd-in2.h b/gnu/usr.bin/binutils/bfd/bfd-in2.h
index edaf2b4e18c..443c539553e 100644
--- a/gnu/usr.bin/binutils/bfd/bfd-in2.h
+++ b/gnu/usr.bin/binutils/bfd/bfd-in2.h
@@ -1628,6 +1628,7 @@ of instruction using the register:
The GNU linker currently doesn't do any of this optimizing. */
BFD_RELOC_ALPHA_LITERAL,
+ BFD_RELOC_ALPHA_LITERALSLEAZY,
BFD_RELOC_ALPHA_LITUSE,
/* The HINT relocation indicates a value that should be filled into the
diff --git a/gnu/usr.bin/binutils/bfd/coff-alpha.c b/gnu/usr.bin/binutils/bfd/coff-alpha.c
index b7a41b572c4..ea77db21ab6 100644
--- a/gnu/usr.bin/binutils/bfd/coff-alpha.c
+++ b/gnu/usr.bin/binutils/bfd/coff-alpha.c
@@ -424,6 +424,23 @@ static reloc_howto_type alpha_howto_table[] =
false, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
+ false), /* pcrel_offset */
+
+ /* Used for an instruction that refers to memory off the GP
+ register. The offset is 16 bits of the 32 bit instruction. This
+ reloc always seems to be against the .lita section. */
+ HOWTO (ALPHA_R_LITERALSLEAZY, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ false, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ 0, /* special_function */
+ "LITERALSLEAZY", /* name */
+ true, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
false) /* pcrel_offset */
};
@@ -645,6 +662,7 @@ alpha_adjust_reloc_in (abfd, intern, rptr)
case ALPHA_R_GPREL32:
case ALPHA_R_LITERAL:
+ case ALPHA_R_LITERALSLEAZY:
/* Copy the gp value for this object file into the addend, to
ensure that we are not confused by the linker. */
if (! intern->r_extern)
@@ -880,6 +898,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
break;
case ALPHA_R_LITERAL:
+ case ALPHA_R_LITERALSLEAZY:
/* This is a reference to a literal value, generally
(always?) in the .lita section. This is a 16 bit GP
relative relocation. Sometimes the subsequent reloc is a
@@ -1193,6 +1212,9 @@ alpha_bfd_reloc_type_lookup (abfd, code)
case BFD_RELOC_ALPHA_LITERAL:
alpha_type = ALPHA_R_LITERAL;
break;
+ case BFD_RELOC_ALPHA_LITERALSLEAZY:
+ alpha_type = ALPHA_R_LITERALSLEAZY;
+ break;
case BFD_RELOC_ALPHA_LITUSE:
alpha_type = ALPHA_R_LITUSE;
break;
@@ -1581,6 +1603,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case ALPHA_R_LITERAL:
+ case ALPHA_R_LITERALSLEAZY:
/* This is a reference to a literal value, generally
(always?) in the .lita section. This is a 16 bit GP
relative relocation. Sometimes the subsequent reloc is a
@@ -1597,6 +1620,10 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
use. This would not be particularly difficult, but it is
not currently implemented. */
+#if 0
+ /* Apparently the belief mentioned just below is in error on
+ BSD systems. */
+
/* I believe that the LITERAL reloc will only apply to a ldq
or ldl instruction, so check my assumption. */
{
@@ -1607,6 +1634,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
BFD_ASSERT (((insn >> 26) & 0x3f) == 0x29
|| ((insn >> 26) & 0x3f) == 0x28);
}
+#endif
relocatep = true;
addend = ecoff_data (input_bfd)->gp - gp;
diff --git a/gnu/usr.bin/binutils/bfd/config.bfd b/gnu/usr.bin/binutils/bfd/config.bfd
index 0ba80caf4d4..f540c87f2f3 100644
--- a/gnu/usr.bin/binutils/bfd/config.bfd
+++ b/gnu/usr.bin/binutils/bfd/config.bfd
@@ -63,6 +63,14 @@ case "${targ}" in
targ_defvec=bfd_elf64_alpha_vec
targ_selvecs=ecoffalpha_little_vec
;;
+ alpha-*-netbsd*)
+ targ_defvec=bsd_ecoffalpha_little_vec
+ targ_selvecs="ecoffalpha_little_vec bfd_elf64_alpha_vec"
+ ;;
+ alpha-*-openbsd*)
+ targ_defvec=bsd_ecoffalpha_little_vec
+ targ_selvecs="ecoffalpha_little_vec bfd_elf64_alpha_vec"
+ ;;
alpha-*-*vms*)
targ_defvec=evax_alpha_vec
;;
diff --git a/gnu/usr.bin/binutils/bfd/ecoff.c b/gnu/usr.bin/binutils/bfd/ecoff.c
index 90928c7b463..0da5e6484ca 100644
--- a/gnu/usr.bin/binutils/bfd/ecoff.c
+++ b/gnu/usr.bin/binutils/bfd/ecoff.c
@@ -230,6 +230,7 @@ static int
ecoff_get_magic (abfd)
bfd *abfd;
{
+ extern const bfd_target bsd_ecoffalpha_little_vec;
int big, little;
switch (bfd_get_arch (abfd))
diff --git a/gnu/usr.bin/binutils/bfd/reloc.c b/gnu/usr.bin/binutils/bfd/reloc.c
index 84e2a5670cb..b71218c9d89 100644
--- a/gnu/usr.bin/binutils/bfd/reloc.c
+++ b/gnu/usr.bin/binutils/bfd/reloc.c
@@ -1910,6 +1910,8 @@ ENUMDOC
ENUM
BFD_RELOC_ALPHA_LITERAL
ENUMX
+ BFD_RELOC_ALPHA_LITERALSLEAZY
+ENUMX
BFD_RELOC_ALPHA_LITUSE
ENUMDOC
The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;