+2017-12-13 Renlin Li <renlin.li@arm.com>
+
+ * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Disallow
+ BFD_RELOC_AARCH64_16 in shared object const section. Disallow
+ BFD_RELOC_AARCH64_32 in shared object const section under LP64.
+
2017-12-11 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
* bfd.c (bfd_get_sign_extend_vma): Correct typo.
switch (bfd_r_type)
{
+ case BFD_RELOC_AARCH64_16:
+#if ARCH_SIZE == 64
+ case BFD_RELOC_AARCH64_32:
+#endif
+ if (bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && (sec->flags & SEC_READONLY) != 0)
+ {
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%B: relocation %s against `%s' can not be used when making "
+ "a shared object"),
+ abfd, elfNN_aarch64_howto_table[howto_index].name,
+ (h) ? h->root.root.string : "a local symbol");
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ else
+ break;
+
case BFD_RELOC_AARCH64_MOVW_G0_NC:
case BFD_RELOC_AARCH64_MOVW_G1_NC:
case BFD_RELOC_AARCH64_MOVW_G2_NC:
+2017-12-13 Renlin Li <renlin.li@arm.com>
+
+ * testsuite/ld-aarch64/aarch64-elf.exp: Run new test cases.
+ * testsuite/ld-aarch64/emit-relocs-258-dyn-bad.d: New.
+ * testsuite/ld-aarch64/emit-relocs-258.s: New.
+ * testsuite/ld-aarch64/emit-relocs-259-dyn-bad.d: New.
+ * testsuite/ld-aarch64/emit-relocs-259.s: New.
+ * testsuite/ld-aarch64/gc-relocs-257.s: Put R_AARCH64_ABS32,
+ R_AARCH64_ABS16 data into data section.
+
2017-12-07 Alan Modra <amodra@gmail.com>
PR 22465
run_dump_test_lp64 "emit-relocs-257-be"
# 258 is tested in 257
# 259 is tested in 257
+run_dump_test_lp64 "emit-relocs-258-dyn-bad"
+run_dump_test_lp64 "emit-relocs-259-dyn-bad"
run_dump_test_lp64 "emit-relocs-260"
run_dump_test_lp64 "emit-relocs-260-be"
# 261 is tested by 260
--- /dev/null
+#name: LP64 R_AARCH64_ABS32 shared library test
+#source: emit-relocs-258.s
+#ld: -shared
+#error: .*: relocation R_AARCH64_ABS32 against `dummy' can not be used when making a shared object
--- /dev/null
+.text
+
+ ldr x0, .L1
+
+.L1:
+ .word dummy
--- /dev/null
+#name: R_AARCH64_ABS16 shared library test
+#source: emit-relocs-259.s
+#ld: -shared
+#error: .*: relocation R_AARCH64_ABS16 against `dummy' can not be used when making a shared object
--- /dev/null
+.text
+
+ ldr x0, .L1
+
+.L1:
+ .hword dummy
.text
- .word tempy
+ and x0, x0, x0
+ and x0, x0, #0x1
.xword tempy2
+
+ .data
+ .word tempy
.hword tempy3
.hword tempy3+8
- and x0, x0, x0
- and x0, x0, #0x1