* [PATCH] PE/x86-64: Display PE relocation names
@ 2020-09-15 20:54 H.J. Lu
0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2020-09-15 20:54 UTC (permalink / raw)
To: binutils
For PE/x86-64, display PE relocation names:
R_X86_64_64 -> IMAGE_REL_AMD64_ADDR64
R_X86_64_32 -> IMAGE_REL_AMD64_ADDR32.
rva32 -> IMAGE_REL_AMD64_ADDR32NB
R_X86_64_PC32 -> IMAGE_REL_AMD64_REL32
DISP32+1 -> IMAGE_REL_AMD64_REL32_1
DISP32+2 -> IMAGE_REL_AMD64_REL32_2
DISP32+3 -> IMAGE_REL_AMD64_REL32_3
DISP32+4 -> IMAGE_REL_AMD64_REL32_4
DISP32+5 -> IMAGE_REL_AMD64_REL32_5
secrel32 -> IMAGE_REL_AMD64_SECREL
bfd/
* coff-x86_64.c (howto_table): Display PE relocation names.
gas/
* testsuite/gas/cfi/reloc-pe-i386.d: Updated.
* testsuite/gas/i386/x86-64-w64-pcrel.d: Likewise.
---
bfd/coff-x86_64.c | 22 +++++++++++-----------
gas/testsuite/gas/cfi/reloc-pe-i386.d | 2 +-
gas/testsuite/gas/i386/x86-64-w64-pcrel.d | 8 ++++----
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c
index a6632910da..3cad00a636 100644
--- a/bfd/coff-x86_64.c
+++ b/bfd/coff-x86_64.c
@@ -222,7 +222,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "R_X86_64_64", /* name */
+ "IMAGE_REL_AMD64_ADDR64", /* name */
TRUE, /* partial_inplace */
0xffffffffffffffffll, /* src_mask */
0xffffffffffffffffll, /* dst_mask */
@@ -235,7 +235,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "R_X86_64_32", /* name */
+ "IMAGE_REL_AMD64_ADDR32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -249,7 +249,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "rva32", /* name */
+ "IMAGE_REL_AMD64_ADDR32NB", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -263,7 +263,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "R_X86_64_PC32", /* name */
+ "IMAGE_REL_AMD64_REL32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -277,7 +277,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "DISP32+1", /* name */
+ "IMAGE_REL_AMD64_REL32_1", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -290,7 +290,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "DISP32+2", /* name */
+ "IMAGE_REL_AMD64_REL32_2", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -303,7 +303,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "DISP32+3", /* name */
+ "IMAGE_REL_AMD64_REL32_3", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -316,7 +316,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "DISP32+4", /* name */
+ "IMAGE_REL_AMD64_REL32_4", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -329,7 +329,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "DISP32+5", /* name */
+ "IMAGE_REL_AMD64_REL32_5", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -345,7 +345,7 @@ static reloc_howto_type howto_table[] =
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
coff_amd64_reloc, /* special_function */
- "secrel32", /* name */
+ "IMAGE_REL_AMD64_SECREL", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
@@ -896,4 +896,4 @@ const bfd_target
&bigobj_swap_table
};
-#endif
\ No newline at end of file
+#endif
diff --git a/gas/testsuite/gas/cfi/reloc-pe-i386.d b/gas/testsuite/gas/cfi/reloc-pe-i386.d
index 506246cd14..dc12629f37 100644
--- a/gas/testsuite/gas/cfi/reloc-pe-i386.d
+++ b/gas/testsuite/gas/cfi/reloc-pe-i386.d
@@ -3,7 +3,7 @@
#...
RELOCATION RECORDS FOR \[.debug_frame\]:
OFFSET .* TYPE .* VALUE
-0.* secrel32 .* .debug_frame
+0.* (secrel32|IMAGE_REL_AMD64_SECREL) .* .debug_frame
0.* .* .text
diff --git a/gas/testsuite/gas/i386/x86-64-w64-pcrel.d b/gas/testsuite/gas/i386/x86-64-w64-pcrel.d
index b3eb1d8450..22cc33516b 100644
--- a/gas/testsuite/gas/i386/x86-64-w64-pcrel.d
+++ b/gas/testsuite/gas/i386/x86-64-w64-pcrel.d
@@ -9,12 +9,12 @@ Disassembly of section .text:
0+000 <_start>:
[ ]*[0-9a-f]+:[ ]+b0 02[ ]+movb?[ ]+\$(0x)?2,%al[ ]*[0-9a-f]+:[ ]+R_X86_64_PC8[ ]+xtrn
[ ]*[0-9a-f]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]*[0-9a-f]+:[ ]+R_X86_64_32S[ ]+xtrn
-[ ]*[0-9a-f]+:[ ]+48 b8( 00){8}[ ]+mov(abs)?q?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+R_X86_64_64[ ]+xtrn
+[ ]*[0-9a-f]+:[ ]+48 b8( 00){8}[ ]+mov(abs)?q?[ ]+\$(0x)?0,%rax[ ]*[0-9a-f]+:[ ]+IMAGE_REL_AMD64_ADDR64[ ]+xtrn
#pass
--
2.26.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-15 20:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15 20:54 [PATCH] PE/x86-64: Display PE relocation names H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).