This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] x86: Define PLT_CIE_LENGTH and PLT_FDE_* in elfxx-x86.h
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 2 Sep 2017 11:13:12 -0700
- Subject: [committed, PATCH] x86: Define PLT_CIE_LENGTH and PLT_FDE_* in elfxx-x86.h
- Authentication-results: sourceware.org; auth=none
Since PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET and
PLT_FDE_LEN_OFFSET are identical in elf32-i386.c and elf64-x86-64.c,
they can be defined in elfxx-x86.h.
* elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
* elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
* elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
---
bfd/ChangeLog | 9 +++++++++
bfd/elf32-i386.c | 4 ----
bfd/elf64-x86-64.c | 4 ----
bfd/elfxx-x86.h | 5 +++++
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4d6fb59560..23cb882817 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,14 @@
2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
+ * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
+ PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
+ * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
+ PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
+ * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
+ PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
+
+2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
+
* elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
(elf_i386_allocate_local_dynrelocs): Likewise.
(elf_i386_size_dynamic_sections): Replace
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 2caff7f96b..034511cb58 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -656,10 +656,6 @@ static const bfd_byte elf_i386_pic_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
static const bfd_byte elf_i386_eh_frame_lazy_plt[] =
{
-#define PLT_CIE_LENGTH 20
-#define PLT_FDE_LENGTH 36
-#define PLT_FDE_START_OFFSET 4 + PLT_CIE_LENGTH + 8
-#define PLT_FDE_LEN_OFFSET 4 + PLT_CIE_LENGTH + 12
PLT_CIE_LENGTH, 0, 0, 0, /* CIE length */
0, 0, 0, 0, /* CIE ID */
1, /* CIE version */
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index ed67d89786..08a8c92d68 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -647,10 +647,6 @@ static const bfd_byte elf_x32_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
static const bfd_byte elf_x86_64_eh_frame_lazy_plt[] =
{
-#define PLT_CIE_LENGTH 20
-#define PLT_FDE_LENGTH 36
-#define PLT_FDE_START_OFFSET 4 + PLT_CIE_LENGTH + 8
-#define PLT_FDE_LEN_OFFSET 4 + PLT_CIE_LENGTH + 12
PLT_CIE_LENGTH, 0, 0, 0, /* CIE length */
0, 0, 0, 0, /* CIE ID */
1, /* CIE version */
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index c694daf0fc..00d38de984 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -26,6 +26,11 @@
#include "bfd_stdint.h"
#include "hashtab.h"
+#define PLT_CIE_LENGTH 20
+#define PLT_FDE_LENGTH 36
+#define PLT_FDE_START_OFFSET 4 + PLT_CIE_LENGTH + 8
+#define PLT_FDE_LEN_OFFSET 4 + PLT_CIE_LENGTH + 12
+
#define ABI_64_P(abfd) \
(get_elf_backend_data (abfd)->s->elfclass == ELFCLASS64)
--
2.13.5