aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorRichard Earnshaw <richard.earnshaw@arm.com>2012-09-12 16:25:51 +0000
committerRichard Earnshaw <richard.earnshaw@arm.com>2012-09-12 16:25:51 +0000
commitf41aef5f6e10edcded9a747dc2bdc9832b940dc7 (patch)
tree0bf2b26ce0a0a473aa97b09e7a195ce29ab6d155 /bfd
parenta67fa328adaa260bc9293d4ea9058e12e2176cbc (diff)
downloadgdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.zip
gdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.tar.gz
gdb-f41aef5f6e10edcded9a747dc2bdc9832b940dc7.tar.bz2
2012-09-11 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
bfd/ * bfd-in2.h: Regenerated. * elf64-aarch64.c (elf64_aarch64_howto_table): Add R_AARCH64_GOT_LD_PREL19 reloc to HOWTO. (elf64_aarch64_reloc_map): Add reloc entry. (aarch64_resolve_relocation): Likewise. (bfd_elf_aarch64_put_addend): Likewise. (aarch64_reloc_got_type): Likewise. (elf64_aarch64_final_link_relocate): Likewise. (lf64_aarch64_check_relocs): Likewise. (elf64_aarch64_check_relocs): New case for R_AARCH64_ADR_PREL_LO21 reloc. * libbfd.h: Regenerated. * reloc.c (R_AARCH64_GOT_LD_PREL19): New reloc. gas/ * config/tc-aarch64.c (reloc_table): Add reloc to table entry. (parse_address_main): Add support for #:<reloc_op>:<symbol>. (parse_operands): Check for unused reloc. (md_apply_fix): New case for reloc. (aarch64_force_relocation): Likewise. gas/testsuite * gas/aarch64/reloc-insn.d (BFD_RELOC_AARCH64_GOT_LD_PREL19): Add expected asm for new reloc test. * gas/aarch64/reloc-insn.s (BFD_RELOC_AARCH64_GOT_LD_PREL19): Add test for reloc. include/ * elf/aarch64.h (R_AARCH64_GOT_LD_PREL19): New reloc. ld/testsuite * ld-aarch64/aarch64-elf.exp: New reloc tests. * ld-aarch64/emit-relocs-309-low-bad.d: New file. Expected asm for test failure (lower bound overflow). * ld-aarch64/emit-relocs-309-low.d: New file. Expected asm for test success (lower bound). * ld-aarch64/emit-relocs-309-up-bad.d: New file. Expected asm for test failure (upper bound overflow). * ld-aarch64/emit-relocs-309-up.d: New file. Expected asm for test success (upper bound). * ld-aarch64/emit-relocs-309.s: New file. Asm for new reloc tests.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog16
-rw-r--r--bfd/elf64-aarch64.c28
-rw-r--r--bfd/reloc.c8
3 files changed, 51 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e678d3a..89e9b74 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,19 @@
+2012-09-12 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
+
+ * bfd-in2.h: Regenerated.
+ * elf64-aarch64.c
+ (elf64_aarch64_howto_table): Add R_AARCH64_GOT_LD_PREL19 reloc to HOWTO.
+ (elf64_aarch64_reloc_map): Add reloc entry.
+ (aarch64_resolve_relocation): Likewise.
+ (bfd_elf_aarch64_put_addend): Likewise.
+ (aarch64_reloc_got_type): Likewise.
+ (elf64_aarch64_final_link_relocate): Likewise.
+ (lf64_aarch64_check_relocs): Likewise.
+ (elf64_aarch64_check_relocs): New case for R_AARCH64_ADR_PREL_LO21
+ reloc.
+ * libbfd.h: Regenerated.
+ * reloc.c (R_AARCH64_GOT_LD_PREL19): New reloc.
+
2012-09-10 Matthias Klose <doko@ubuntu.com>
* config.in: Disable sanity check for kfreebsd.
diff --git a/bfd/elf64-aarch64.c b/bfd/elf64-aarch64.c
index 648ca7f..0607b3a 100644
--- a/bfd/elf64-aarch64.c
+++ b/bfd/elf64-aarch64.c
@@ -908,7 +908,23 @@ static reloc_howto_type elf64_aarch64_howto_table[] =
EMPTY_HOWTO (306),
EMPTY_HOWTO (307),
EMPTY_HOWTO (308),
- EMPTY_HOWTO (309),
+
+ /* Set a load-literal immediate field to bits
+ 0x1FFFFC of G(S)-P */
+ HOWTO (R_AARCH64_GOT_LD_PREL19, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte,1 = short,2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AARCH64_GOT_LD_PREL19", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffe0, /* src_mask */
+ 0xffffe0, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
EMPTY_HOWTO (310),
/* Get to the page for the GOT entry for the symbol
@@ -1427,6 +1443,7 @@ static const struct elf64_aarch64_reloc_map elf64_aarch64_reloc_map[] =
{BFD_RELOC_AARCH64_CALL26, R_AARCH64_CALL26},
/* Relocations for PIC. */
+ {BFD_RELOC_AARCH64_GOT_LD_PREL19, R_AARCH64_GOT_LD_PREL19},
{BFD_RELOC_AARCH64_ADR_GOT_PAGE, R_AARCH64_ADR_GOT_PAGE},
{BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, R_AARCH64_LD64_GOT_LO12_NC},
@@ -2143,6 +2160,10 @@ aarch64_resolve_relocation (unsigned int r_type, bfd_vma place, bfd_vma value,
value = PG (value + addend) - PG (place);
break;
+ case R_AARCH64_GOT_LD_PREL19:
+ value = value + addend - place;
+ break;
+
case R_AARCH64_ADR_GOT_PAGE:
case R_AARCH64_TLSDESC_ADR_PAGE:
case R_AARCH64_TLSGD_ADR_PAGE21:
@@ -3362,6 +3383,7 @@ bfd_elf_aarch64_put_addend (bfd *abfd,
break;
case R_AARCH64_LD_PREL_LO19:
+ case R_AARCH64_GOT_LD_PREL19:
if (old_addend & ((1 << howto->rightshift) - 1))
return bfd_reloc_overflow;
contents = reencode_ld_lit_ofs_19 (contents, addend);
@@ -3570,6 +3592,7 @@ aarch64_reloc_got_type (unsigned int r_type)
{
case R_AARCH64_LD64_GOT_LO12_NC:
case R_AARCH64_ADR_GOT_PAGE:
+ case R_AARCH64_GOT_LD_PREL19:
return GOT_NORMAL;
case R_AARCH64_TLSGD_ADR_PAGE21:
@@ -3992,6 +4015,7 @@ elf64_aarch64_final_link_relocate (reloc_howto_type *howto,
case R_AARCH64_LD64_GOT_LO12_NC:
case R_AARCH64_ADR_GOT_PAGE:
+ case R_AARCH64_GOT_LD_PREL19:
if (globals->root.sgot == NULL)
BFD_ASSERT (h != NULL);
@@ -5116,6 +5140,7 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* RR: We probably want to keep a consistency check that
there are no dangling GOT_PAGE relocs. */
case R_AARCH64_LD64_GOT_LO12_NC:
+ case R_AARCH64_GOT_LD_PREL19:
case R_AARCH64_ADR_GOT_PAGE:
case R_AARCH64_TLSGD_ADR_PAGE21:
case R_AARCH64_TLSGD_ADD_LO12_NC:
@@ -5201,6 +5226,7 @@ elf64_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
case R_AARCH64_ADR_PREL_PG_HI21_NC:
case R_AARCH64_ADR_PREL_PG_HI21:
+ case R_AARCH64_ADR_PREL_LO21:
if (h != NULL && info->executable)
{
/* If this reloc is in a read-only section, we might
diff --git a/bfd/reloc.c b/bfd/reloc.c
index dc01dd9..f8540a7 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -5889,6 +5889,14 @@ ENUMDOC
AArch64 ADD immediate instruction, holding bits 0 to 11 of the address.
Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL.
ENUM
+ BFD_RELOC_AARCH64_GOT_LD_PREL19
+ENUMDOC
+ AArch64 Load Literal instruction, holding a 19 bit PC relative word
+ offset of the global offset table entry for a symbol. The lowest two
+ bits must be zero and are not stored in the instruction, giving a 21
+ bit signed byte offset. This relocation type requires signed overflow
+ checking.
+ENUM
BFD_RELOC_AARCH64_ADR_GOT_PAGE
ENUMDOC
Get to the page base of the global offset table entry for a symbol as