* [PATCH][OBVIOUS] bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels
@ 2017-06-06 7:15 Jose E. Marchesi
2017-06-06 7:47 ` Jose E. Marchesi
0 siblings, 1 reply; 3+ messages in thread
From: Jose E. Marchesi @ 2017-06-06 7:15 UTC (permalink / raw)
To: binutils
056bafd broke the build in ELF targets [-Werror=unused-but-set-variable]
I just pushed the fix below as obvious.
commit fbebaf4a56dd03251bc2e12fa6834d90555aa82a
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Tue Jun 6 00:01:58 2017 -0700
bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels
bfd/ChangeLog:
2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
* elflink.c (init_reloc_cookie_rels): Remove unused variable
`bed'.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a138535..80bac36 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * elflink.c (init_reloc_cookie_rels): Remove unused variable
+ `bed'.
+
2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 07d3ea5..7b001b7 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12572,8 +12572,6 @@ init_reloc_cookie_rels (struct elf_reloc_cookie *cookie,
struct bfd_link_info *info, bfd *abfd,
asection *sec)
{
- const struct elf_backend_data *bed;
-
if (sec->reloc_count == 0)
{
cookie->rels = NULL;
@@ -12581,8 +12579,6 @@ init_reloc_cookie_rels (struct elf_reloc_cookie *cookie,
}
else
{
- bed = get_elf_backend_data (abfd);
-
cookie->rels = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
info->keep_memory);
if (cookie->rels == NULL)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][OBVIOUS] bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels
2017-06-06 7:15 [PATCH][OBVIOUS] bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels Jose E. Marchesi
@ 2017-06-06 7:47 ` Jose E. Marchesi
2017-06-06 16:19 ` Maciej W. Rozycki
0 siblings, 1 reply; 3+ messages in thread
From: Jose E. Marchesi @ 2017-06-06 7:47 UTC (permalink / raw)
To: binutils
Turns out a few more targets were also impacted.
After this patch --enable-targets=all builds, so I think we are good...
commit 458ad2b83ecf4d764703767bccf19723ca741f00
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date: Tue Jun 6 00:33:20 2017 -0700
bfd: remove unused local variables in elf32-score, elf32-score7 and elfxx-mips
bfd/ChangeLog:
2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
* elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
variable `bed'.
* elf32-score.c (score_elf_final_link_relocate): Likewise.
(s3_bfd_score_elf_check_relocs): Likewise.
* elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
(score_elf_final_link_relocate): Likewise.
(s7_bfd_score_elf_check_relocs): Likewise.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 80bac36..7dfc62f 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,15 @@
2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
+ variable `bed'.
+ * elf32-score.c (score_elf_final_link_relocate): Likewise.
+ (s3_bfd_score_elf_check_relocs): Likewise.
+ * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
+ (score_elf_final_link_relocate): Likewise.
+ (s7_bfd_score_elf_check_relocs): Likewise.
+
+2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
+
* elflink.c (init_reloc_cookie_rels): Remove unused variable
`bed'.
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index a8914e6..5429476 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -2034,10 +2034,8 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
{
const Elf_Internal_Rela *relend;
const Elf_Internal_Rela *lo16_rel;
- const struct elf_backend_data *bed;
bfd_vma lo_value = 0;
- bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if ((local_p) && (lo16_rel != NULL))
@@ -2778,7 +2776,6 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *sreloc;
- const struct elf_backend_data *bed;
if (bfd_link_relocatable (info))
return TRUE;
@@ -2807,7 +2804,6 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
}
sreloc = NULL;
- bed = get_elf_backend_data (abfd);
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; ++rel)
{
diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c
index 5075fa4..66e7945 100644
--- a/bfd/elf32-score7.c
+++ b/bfd/elf32-score7.c
@@ -1902,10 +1902,8 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
{
const Elf_Internal_Rela *relend;
const Elf_Internal_Rela *lo16_rel;
- const struct elf_backend_data *bed;
bfd_vma lo_value = 0;
- bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if ((local_p) && (lo16_rel != NULL))
@@ -1935,7 +1933,6 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
{
const Elf_Internal_Rela *relend;
const Elf_Internal_Rela *lo16_rel;
- const struct elf_backend_data *bed;
bfd_vma lo_value = 0;
value = bfd_get_32 (input_bfd, contents + rel->r_offset);
@@ -1943,7 +1940,6 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
if ((addend & 0x4000) == 0x4000)
addend |= 0xffffc000;
- bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if ((local_p) && (lo16_rel != NULL))
@@ -2471,7 +2467,6 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
if (r_type == R_SCORE_GOT15)
{
const Elf_Internal_Rela *lo16_rel;
- const struct elf_backend_data *bed;
bfd_vma lo_addend = 0, lo_value = 0;
bfd_vma addend, value;
@@ -2480,7 +2475,6 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd,
if ((addend & 0x4000) == 0x4000)
addend |= 0xffffc000;
- bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if (lo16_rel != NULL)
@@ -2587,7 +2581,6 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
const Elf_Internal_Rela *rel_end;
asection *sgot;
asection *sreloc;
- const struct elf_backend_data *bed;
if (bfd_link_relocatable (info))
return TRUE;
@@ -2616,7 +2609,6 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
}
sreloc = NULL;
- bed = get_elf_backend_data (abfd);
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; ++rel)
{
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 1ef27f6..830207a 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -10031,9 +10031,7 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
const Elf_Internal_Rela *relend;
bfd_vma addend = 0;
bfd_boolean use_saved_addend_p = FALSE;
- const struct elf_backend_data *bed;
- bed = get_elf_backend_data (output_bfd);
relend = relocs + input_section->reloc_count;
for (rel = relocs; rel < relend; ++rel)
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][OBVIOUS] bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels
2017-06-06 7:47 ` Jose E. Marchesi
@ 2017-06-06 16:19 ` Maciej W. Rozycki
0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2017-06-06 16:19 UTC (permalink / raw)
To: Jose E. Marchesi; +Cc: binutils
Hi Jose,
> Turns out a few more targets were also impacted.
> After this patch --enable-targets=all builds, so I think we are good...
I think so as well as this is also the exact change I have come up with,
but you were faster! :) Thanks for fixing up the breakage and sorry to
cause it in the first place. This didn't trigger with GCC 4.4 I verified
this commit with.
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-06 16:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 7:15 [PATCH][OBVIOUS] bfd: remove unused local variable in elflink.c:init_reloc_cookie_rels Jose E. Marchesi
2017-06-06 7:47 ` Jose E. Marchesi
2017-06-06 16:19 ` Maciej W. Rozycki
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).