Add support for COFF secidx relocations
authorMark Harmstone <mark@harmstone.com>
Thu, 7 Apr 2022 13:47:17 +0000 (14:47 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 7 Apr 2022 13:47:17 +0000 (14:47 +0100)
commit145667f8d991932165a70d7c1551620be44e4b4f
tree1166831bf54cbafa71f078c8a567a4fd2b36ee21
parent591cc9fbbfd6d51131c0f1d4a92e7893edcc7a28
Add support for COFF secidx relocations

bfd * coff-i386.c (in_reloc_p): Add R_SECTION.
(howto_table): Add R_SECTION.
(coff_pe_i386_relocation_section): Add support for R_SECTION.
(coff_i386_reloc_type_lookup): Add support for
BFD_RELOC_16_SECCIDX.
* coff-x86_64.c (in_reloc_p): Add R_SECTION.
(howto_table): Add R_SECTION.
(coff_pe_amd64_relocation_section): Add support for R_SECTION.
(coff_amd64_reloc_type_lookup): Add support for
BFD_RELOC_16_SECCIDX.
* reloc.c: Add BFD_RELOC_16_SECIDX.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.

gas * config/tc-i386.c (pe_directive_secidx): New function.
(md_pseudo_table): Add support for secidx.
(x86_cons_fix_new): Likewise.
(tc_gen_reloc): Likewise.
* expr.c (op_rank): Add O_secidx.
* expr.h (operatorT): Likewise.
* symbols.c (resolve_symbol_value): Add support for O_secidx.
* testsuite/gas/i386/secidx.s: New test source file.
* testsuite/gas/i386/secidx.d: New test driver file.
* testsuite/gas/i386/i386.exp: Run new test.

include * coff/i386.h: Define R_SECTION.
* coff/x86_64.h: Likewise.

ld * testsuite/ld-pe/secidx1.s: New test source file.
* testsuite/ld-pe/secidx2.s: New test source file.
* testsuite/ld-pe/secidx.d: New test driver file.
* testsuite/ld-pe/secidx_64.d: New test driver file.
* testsuite/ld-pe/pe.exp: Add new tests.
23 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/coff-i386.c
bfd/coff-x86_64.c
bfd/libbfd.h
bfd/reloc.c
gas/ChangeLog
gas/config/tc-i386.c
gas/expr.c
gas/expr.h
gas/symbols.c
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/secidx.d [new file with mode: 0644]
gas/testsuite/gas/i386/secidx.s [new file with mode: 0644]
include/ChangeLog
include/coff/i386.h
include/coff/x86_64.h
ld/ChangeLog
ld/testsuite/ld-pe/pe.exp
ld/testsuite/ld-pe/secidx.d [new file with mode: 0644]
ld/testsuite/ld-pe/secidx1.s [new file with mode: 0644]
ld/testsuite/ld-pe/secidx2.s [new file with mode: 0644]
ld/testsuite/ld-pe/secidx_64.d [new file with mode: 0644]