From b0360d8cfa52ee52bbc76ca90f4caf1f9cb3f64f Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 3 Aug 2005 16:30:34 +0000 Subject: [PATCH] bfd/ 2005-08-03 H.J. Lu * elf32-i386.c (elf_howto_table): Undo the overflow change for R_386_PC16 made on 2005-07-18. * elf64-x86-64.c (x86_64_elf_howto_table): Undo the overflow change for R_X86_64_PC16 made on 2005-07-18. ld/testsuite/ 2005-08-03 H.J. Lu * ld-i386/pcrel16.d: Updated. * ld-i386/pcrel16.s: Likewise. * ld-x86-64/pcrel16.d: Likewise. --- bfd/ChangeLog | 8 ++++++++ bfd/elf32-i386.c | 2 +- bfd/elf64-x86-64.c | 2 +- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-i386/pcrel16.d | 15 +++++++++++++-- ld/testsuite/ld-i386/pcrel16.s | 18 ++++++++---------- ld/testsuite/ld-x86-64/pcrel16.d | 15 +++++++++++++-- 7 files changed, 50 insertions(+), 16 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 9a5747007b0..f413454ae30 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2005-08-03 H.J. Lu + + * elf32-i386.c (elf_howto_table): Undo the overflow change for + R_386_PC16 made on 2005-07-18. + + * elf64-x86-64.c (x86_64_elf_howto_table): Undo the overflow + change for R_X86_64_PC16 made on 2005-07-18. + 2005-08-03 Alan Modra * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove hgot. Use diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index a9dff218cab..48e76e916e8 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -95,7 +95,7 @@ static reloc_howto_type elf_howto_table[]= 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_signed, + HOWTO(R_386_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_PC16", TRUE, 0xffff, 0xffff, TRUE), HOWTO(R_386_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index c100f3ea78a..196b237bdb2 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -73,7 +73,7 @@ static reloc_howto_type x86_64_elf_howto_table[] = 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_signed, + HOWTO(R_X86_64_PC16,0, 1, 16, TRUE, 0, complain_overflow_bitfield, 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), diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index aa755107a21..88d170b30b1 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-08-03 H.J. Lu + + * ld-i386/pcrel16.d: Updated. + * ld-i386/pcrel16.s: Likewise. + * ld-x86-64/pcrel16.d: Likewise. + 2005-08-01 Richard Sandiford * ld-mips/mips-elf-flags.exp: Add more good_combination tests. diff --git a/ld/testsuite/ld-i386/pcrel16.d b/ld/testsuite/ld-i386/pcrel16.d index 1e8f1821f1c..0c438a95f58 100644 --- a/ld/testsuite/ld-i386/pcrel16.d +++ b/ld/testsuite/ld-i386/pcrel16.d @@ -1,3 +1,14 @@ #name: PCREL16 overflow -#ld: -#error: .*relocation truncated to fit: R_386_PC16 .* +#ld: -Ttext 0x0 +#objdump: -drj.text -m i8086 + +.*: +file format elf32-i386 + +Disassembly of section .text: + +0+ <_start>: + ... + 420: cd 42[ ]+int \$0x42 + 422: ca 02 00[ ]+lret \$0x2 + ... + f065: e9 b8 13[ ]+jmp 420 <_start\+0x420> diff --git a/ld/testsuite/ld-i386/pcrel16.s b/ld/testsuite/ld-i386/pcrel16.s index 269d9caa9f3..d68a6c63140 100644 --- a/ld/testsuite/ld-i386/pcrel16.s +++ b/ld/testsuite/ld-i386/pcrel16.s @@ -1,11 +1,9 @@ - .text - .code16 - .global _start, fwd + .code16 + .text + .globl _start _start: - jpo fwd - .rept 2500 - testl $0x12345678, %ss:0x76543210(,%eax,4) - .endr -fwd: - leave - ret + .org 0x420 + int $0x42 + lret $2 + .org 0xf065 + jmp _start+((0x42) << 4) diff --git a/ld/testsuite/ld-x86-64/pcrel16.d b/ld/testsuite/ld-x86-64/pcrel16.d index 41da975b20c..f593657271f 100644 --- a/ld/testsuite/ld-x86-64/pcrel16.d +++ b/ld/testsuite/ld-x86-64/pcrel16.d @@ -1,4 +1,15 @@ #name: PCREL16 overflow #source: ../ld-i386/pcrel16.s -#ld: -#error: .*relocation truncated to fit: R_X86_64_PC16 .* +#ld: -Ttext 0x0 +#objdump: -drj.text -m i8086 + +.*: +file format elf64-x86-64 + +Disassembly of section .text: + +0+ <_start>: + ... + 420: cd 42[ ]+int \$0x42 + 422: ca 02 00[ ]+lret \$0x2 + ... + f065: e9 b8 13[ ]+jmp 420 <_start\+0x420> -- 2.30.2