aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2025-07-17 13:18:05 +0100
committerSam James <sam@gentoo.org>2025-07-17 13:18:55 +0100
commitd3d1718602b179d8ec833851f5cb67ab9d314a92 (patch)
treedb9d8ddde5e49713110913033d28c2a08199295a
parent11153b13a56dae4ddd068ccf812ebc295783edf9 (diff)
downloadbinutils-d3d1718602b179d8ec833851f5cb67ab9d314a92.zip
binutils-d3d1718602b179d8ec833851f5cb67ab9d314a92.tar.gz
binutils-d3d1718602b179d8ec833851f5cb67ab9d314a92.tar.bz2
binutils: drop unused note_size, contents, old variables
GCC trunk recently had improvements to its -Wunused-but-set-variable which picked up that contents and hence note_size & old aren't used at all in the end. * objcopy.c (merge_gnu_build_notes): Drop unused 'note_size', 'contents', and 'old' variables.
-rw-r--r--binutils/objcopy.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 8c90773..2ca04e8 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -2529,7 +2529,6 @@ merge_gnu_build_notes (bfd * abfd,
/* Reconstruct the ELF notes. */
bfd_byte * new_contents;
- bfd_byte * old;
bfd_byte * new;
bfd_vma prev_start = 0;
bfd_vma prev_end = 0;
@@ -2537,12 +2536,8 @@ merge_gnu_build_notes (bfd * abfd,
/* Not sure how, but the notes might grow in size.
(eg see PR 1774507). Allow for this here. */
new = new_contents = xmalloc (size * 2);
- for (pnote = pnotes, old = contents;
- pnote < pnotes_end;
- pnote ++)
+ for (pnote = pnotes; pnote < pnotes_end; pnote ++)
{
- bfd_size_type note_size = 12 + pnote->padded_namesz + pnote->note.descsz;
-
if (! is_deleted_note (pnote))
{
/* Create the note, potentially using the
@@ -2585,8 +2580,6 @@ merge_gnu_build_notes (bfd * abfd,
prev_end = pnote->end;
}
}
-
- old += note_size;
}
#if DEBUG_MERGE