* [committed, PATCH] Replace input_bfd and output_bfd with abfd
@ 2015-05-10 13:46 H.J. Lu
0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2015-05-10 13:46 UTC (permalink / raw)
To: binutils
The first argument to bfd_get_8/bfd_put_8 isn't used. But we should
use something real. Replace input_bfd and output_bfd with abfd.
* elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
and output_bfd with abfd.
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
---
bfd/ChangeLog | 6 ++++++
bfd/elf32-i386.c | 12 ++++--------
bfd/elf64-x86-64.c | 12 ++++--------
3 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 000cd71..f8e97ce 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2015-05-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf32-i386.c (elf_i386_convert_mov_to_lea): Replace input_bfd
+ and output_bfd with abfd.
+ * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise.
+
2015-05-06 Toni Spets <toni.spets@iki.fi>
PR ld/18372
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 10657f1..715961a 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -2724,11 +2724,9 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec,
/* STT_GNU_IFUNC must keep R_386_GOT32 relocation. */
if (ELF_ST_TYPE (isym->st_info) != STT_GNU_IFUNC
&& irel->r_offset >= 2
- && bfd_get_8 (input_bfd,
- contents + irel->r_offset - 2) == 0x8b)
+ && bfd_get_8 (abfd, contents + irel->r_offset - 2) == 0x8b)
{
- bfd_put_8 (output_bfd, 0x8d,
- contents + irel->r_offset - 2);
+ bfd_put_8 (abfd, 0x8d, contents + irel->r_offset - 2);
irel->r_info = ELF32_R_INFO (r_symndx, R_386_GOTOFF);
if (local_got_refcounts != NULL
&& local_got_refcounts[r_symndx] > 0)
@@ -2754,11 +2752,9 @@ elf_i386_convert_mov_to_lea (bfd *abfd, asection *sec,
&& h != htab->elf.hdynamic
&& SYMBOL_REFERENCES_LOCAL (link_info, h)
&& irel->r_offset >= 2
- && bfd_get_8 (input_bfd,
- contents + irel->r_offset - 2) == 0x8b)
+ && bfd_get_8 (abfd, contents + irel->r_offset - 2) == 0x8b)
{
- bfd_put_8 (output_bfd, 0x8d,
- contents + irel->r_offset - 2);
+ bfd_put_8 (abfd, 0x8d, contents + irel->r_offset - 2);
irel->r_info = ELF32_R_INFO (r_symndx, R_386_GOTOFF);
if (h->got.refcount > 0)
h->got.refcount -= 1;
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index a3604c7..34e0f83 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2945,11 +2945,9 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
/* STT_GNU_IFUNC must keep R_X86_64_GOTPCREL relocation. */
if (ELF_ST_TYPE (isym->st_info) != STT_GNU_IFUNC
&& irel->r_offset >= 2
- && bfd_get_8 (input_bfd,
- contents + irel->r_offset - 2) == 0x8b)
+ && bfd_get_8 (abfd, contents + irel->r_offset - 2) == 0x8b)
{
- bfd_put_8 (output_bfd, 0x8d,
- contents + irel->r_offset - 2);
+ bfd_put_8 (abfd, 0x8d, contents + irel->r_offset - 2);
irel->r_info = htab->r_info (r_symndx, R_X86_64_PC32);
if (local_got_refcounts != NULL
&& local_got_refcounts[r_symndx] > 0)
@@ -2976,11 +2974,9 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
&& h != htab->elf.hdynamic
&& SYMBOL_REFERENCES_LOCAL (link_info, h)
&& irel->r_offset >= 2
- && bfd_get_8 (input_bfd,
- contents + irel->r_offset - 2) == 0x8b)
+ && bfd_get_8 (abfd, contents + irel->r_offset - 2) == 0x8b)
{
- bfd_put_8 (output_bfd, 0x8d,
- contents + irel->r_offset - 2);
+ bfd_put_8 (abfd, 0x8d, contents + irel->r_offset - 2);
irel->r_info = htab->r_info (r_symndx, R_X86_64_PC32);
if (h->got.refcount > 0)
h->got.refcount -= 1;
--
2.1.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-10 13:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-10 13:46 [committed, PATCH] Replace input_bfd and output_bfd with abfd 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).