mirror of
https://github.com/bminor/binutils-gdb.git
synced 2026-04-05 11:19:53 +00:00
x86: Restore PC16 relocation overflow check
The x86-64 psABI has --- A program or object file using R_X86_64_8, R_X86_64_16, R_X86_64_PC16 or R_X86_64_PC8 relocations is not conformant to this ABI, these relocations are only added for documentation purposes. --- Since x86 PC16 relocations have been used for 16-bit programs in an ELF32 or ELF64 container, PC16 relocation should wrap-around in 16-bit address space. Revert commita7664973b2Author: Jan Beulich <jbeulich@suse.com> Date: Mon Apr 26 10:41:35 2021 +0200 x86: correct overflow checking for 16-bit PC-relative relocs and xfail the related tests. Also revert commit50c95a739cAuthor: H.J. Lu <hjl.tools@gmail.com> Date: Wed May 26 12:13:13 2021 -0700 x86: Propery check PC16 reloc overflow in 16-bit mode instructions while keeping PR ld/27905 tests for PC16 relocation in 16-bit programs. bfd/ PR ld/27905 * elf32-i386.c: Don't include "libiberty.h". (elf_howto_table): Revert commitsa7664973b2and50c95a739c. (elf_i386_rtype_to_howto): Revert commit50c95a739c. (elf_i386_info_to_howto_rel): Likewise. (elf_i386_tls_transition): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (x86_64_elf_howto_table): Revert commitsa7664973b2and50c95a739c. (elf_x86_64_rtype_to_howto): Revert commit50c95a739c. * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Likewise. * elfxx-x86.h (elf_x86_obj_tdata): Likewise. (elf_x86_has_code16): Likewise. binutils/ PR ld/27905 * readelf.c (decode_x86_feature_2): Revert commit50c95a739c. gas/ PR ld/27905 * config/tc-i386.c (set_code_flag): Revert commit50c95a739c. (set_16bit_gcc_code_flag): Likewise. (x86_cleanup): Likewise. * testsuite/gas/i386/code16-2.d: Updated. * testsuite/gas/i386/x86-64-code16-2.d: Likewise. include/ PR ld/27905 * elf/common.h (GNU_PROPERTY_X86_FEATURE_2_CODE16): Removed. ld/ PR ld/27905 * testsuite/ld-i386/pcrel16-2.d: xfail. * testsuite/ld-x86-64/pcrel16-2.d: Likewise.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2021-05-28 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/27905
|
||||
* elf/common.h (GNU_PROPERTY_X86_FEATURE_2_CODE16): Removed.
|
||||
|
||||
2021-05-26 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/27905
|
||||
|
||||
Reference in New Issue
Block a user