+2021-04-26 Jan Beulich <jbeulich@suse.com>
+
+ * elf32-i386.c (elf_howto_table): Switch R_386_PC16 to
+ complain_overflow_signed.
+ * elf64-x86-64.c (x86_64_elf_howto_table): Switch R_X86_64_PC16
+ to complain_overflow_signed.
+
2021-04-23 Eric Botcazou <ebotcazou@adacore.com>
* elf.c (special_sections_p): Add .persistent.bss.
HOWTO(R_386_16, 0, 1, 16, false, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_386_16",
true, 0xffff, 0xffff, false),
- HOWTO(R_386_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield,
+ HOWTO(R_386_PC16, 0, 1, 16, true, 0, complain_overflow_signed,
bfd_elf_generic_reloc, "R_386_PC16",
true, 0xffff, 0xffff, true),
HOWTO(R_386_8, 0, 0, 8, false, 0, complain_overflow_bitfield,
false),
HOWTO(R_X86_64_16, 0, 1, 16, false, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_X86_64_16", false, 0xffff, 0xffff, false),
- HOWTO(R_X86_64_PC16,0, 1, 16, true, 0, complain_overflow_bitfield,
+ HOWTO(R_X86_64_PC16, 0, 1, 16, true, 0, complain_overflow_signed,
bfd_elf_generic_reloc, "R_X86_64_PC16", false, 0xffff, 0xffff, true),
HOWTO(R_X86_64_8, 0, 0, 8, false, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_X86_64_8", false, 0xff, 0xff, false),
+2021-04-26 Jan Beulich <jbeulich@suse.com>
+
+ * testsuite/ld-i386/pcrel16-2.s, testsuite/ld-i386/pcrel16-2.d,
+ testsuite/ld-x86-64/pcrel16-2.d: New.
+ * testsuite/ld-i386/i386.exp: Run new test.
+ * testsuite/ld-x86-64/x86-64.exp: Likewise.
+
2021-04-23 H.J. Lu <hongjiu.lu@intel.com>
PR ld/27771
run_dump_test "pcrel8"
run_dump_test "pcrel16"
run_dump_test "pcrel16abs"
+run_dump_test "pcrel16-2"
run_dump_test "alloc"
run_dump_test "warn1"
run_dump_test "tlsgd2"
--- /dev/null
+#name: PCREL16 overflow (2)
+#as: --32
+#ld: -melf_i386
+#error: .*relocation truncated to fit: R_386_PC16 .*t16.*
+#error: .*relocation truncated to fit: R_386_PC16 .*_start.*
--- /dev/null
+ .text
+ .global _start
+_start:
+ data16 xbegin t16
+ ret
+
+ .fill 0x8000,1,0xcc
+
+ .global t16
+t16:
+ data16 xbegin _start
+ ret
--- /dev/null
+#name: PCREL16 overflow (2)
+#source: ../ld-i386/pcrel16-2.s
+#ld:
+#error: .*relocation truncated to fit: R_X86_64_PC16 .*t16.*
+#error: .*relocation truncated to fit: R_X86_64_PC16 .*_start.*
run_dump_test "apic"
run_dump_test "pcrel8"
run_dump_test "pcrel16"
+run_dump_test "pcrel16-2"
run_dump_test "tlsgd2"
run_dump_test "tlsgd3"
run_dump_test "tlsgd12"