This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Replace "link" with "sh_link"
- From: H.J.Lu <hjl at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 14 Apr 2016 15:39:07 -0000
- Subject: [binutils-gdb] Replace "link" with "sh_link"
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7634c4e679156fc6a93ccb8b33898f5cf41eb233
commit 7634c4e679156fc6a93ccb8b33898f5cf41eb233
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Apr 14 08:36:32 2016 -0700
Replace "link" with "sh_link"
On Linux/x86, GCC 4.2 issues a warning:
bfd/elf.c: In function â??_bfd_elf_copy_private_bfd_dataâ??:
bfd/elf.c:1334: warning: declaration of â??linkâ?? shadows a global declaration
/usr/include/unistd.h:757: warning: shadowed declaration is here
make[6]: *** [elf.lo] Error 1
Replace "link" with "sh_link" fixes it.
* elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with
"sh_link".
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf.c | 22 ++++++++++++----------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 0a0dd2c..ac8e8c8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with
+ "sh_link".
+
2016-04-14 Nick Clifton <nickc@redhat.com>
PR target/19938
diff --git a/bfd/elf.c b/bfd/elf.c
index 408dab7..69830ce 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1331,7 +1331,7 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
{
const struct elf_backend_data *bed = get_elf_backend_data (obfd);
bfd_boolean changed = FALSE;
- unsigned int link;
+ unsigned int sh_link;
/* Allow the target a chance to decide how these fields should
be set. */
@@ -1347,11 +1347,12 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
bfd. */
if (iheader->sh_link != SHN_UNDEF)
{
- link = find_link (obfd, iheaders[iheader->sh_link],
- iheader->sh_link);
- if (link != SHN_UNDEF)
+ sh_link = find_link (obfd,
+ iheaders[iheader->sh_link],
+ iheader->sh_link);
+ if (sh_link != SHN_UNDEF)
{
- oheader->sh_link = link;
+ oheader->sh_link = sh_link;
changed = TRUE;
}
else
@@ -1368,15 +1369,16 @@ _bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
but if the SHF_LINK_INFO flag is set then it
should be interpreted as a section index. */
if (iheader->sh_flags & SHF_INFO_LINK)
- link = find_link (obfd, iheaders[iheader->sh_info],
- iheader->sh_info);
+ sh_link = find_link (obfd,
+ iheaders[iheader->sh_info],
+ iheader->sh_info);
else
/* No idea what it means - just copy it. */
- link = iheader->sh_info;
+ sh_link = iheader->sh_info;
- if (link != SHN_UNDEF)
+ if (sh_link != SHN_UNDEF)
{
- oheader->sh_info = link;
+ oheader->sh_info = sh_link;
changed = TRUE;
}
else