This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[commit] rl78: Remove unused variables [Re: [patch] rl78: add relaxation support]
On Fri, 23 Dec 2011 15:44:24 +0100, Jan Kratochvil wrote:
> elf32-rl78.c:2020:11: error: variable ‘sec_start’ set but not used [-Werror=unused-but-set-variable]
> elf32-rl78.c:2013:23: error: variable ‘prev_alignment’ set but not used [-Werror=unused-but-set-variable]
>
> gcc-4.6.2-1.fc17.1.x86_64
I have checked in their removal as I am not sure when you get back online and
it saves some automated builds hassle. It cannot break anything, please
review the code.
Thanks,
Jan
http://sourceware.org/ml/binutils-cvs/2011-12/msg00113.html
--- src/bfd/ChangeLog 2011/12/23 09:23:29 1.5557
+++ src/bfd/ChangeLog 2011/12/23 20:17:58 1.5558
@@ -1,3 +1,7 @@
+2011-12-23 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * elf32-rl78.c (prev_alignment, sec_start): Remove unused variables.
+
2011-12-23 Tristan Gingold <gingold@adacore.com>
* vms-lib.c (vms_traverse_index): Move pointer update code.
--- src/bfd/elf32-rl78.c 2011/12/23 01:49:36 1.3
+++ src/bfd/elf32-rl78.c 2011/12/23 20:17:59 1.4
@@ -2010,14 +2010,12 @@
Elf_Internal_Rela * srel;
Elf_Internal_Rela * irelend;
Elf_Internal_Rela * next_alignment;
- Elf_Internal_Rela * prev_alignment;
bfd_byte * contents = NULL;
bfd_byte * free_contents = NULL;
Elf_Internal_Sym * intsyms = NULL;
Elf_Internal_Sym * free_intsyms = NULL;
Elf_External_Sym_Shndx * shndx_buf = NULL;
bfd_vma pc;
- bfd_vma sec_start;
bfd_vma symval ATTRIBUTE_UNUSED = 0;
int pcrel ATTRIBUTE_UNUSED = 0;
int code ATTRIBUTE_UNUSED = 0;
@@ -2043,8 +2041,6 @@
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
- sec_start = sec->output_section->vma + sec->output_offset;
-
/* Get the section contents. */
if (elf_section_data (sec)->this_hdr.contents != NULL)
contents = elf_section_data (sec)->this_hdr.contents;
@@ -2103,9 +2099,6 @@
/* This will either be NULL or a pointer to the next alignment
relocation. */
next_alignment = internal_relocs;
- /* This will be the previous alignment, although at first it points
- to the first real relocation. */
- prev_alignment = internal_relocs;
/* We calculate worst case shrinkage caused by alignment directives.
No fool-proof, but better than either ignoring the problem or
@@ -2144,7 +2137,6 @@
displacements across an alignment boundary, just in case.
Note that this only affects relocations to the same
section. */
- prev_alignment = next_alignment;
next_alignment += 2;
while (next_alignment < irelend
&& (ELF32_R_TYPE (next_alignment->r_info) != R_RL78_RH_RELAX