Commit ccfbfdaf authored by Simon Marlow's avatar Simon Marlow

fix new warnings with gcc 4.6

parent 4104a615
......@@ -4206,18 +4206,24 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
{
int j;
char *symbol = NULL;
Elf_Addr targ;
Elf_Rela* rtab = (Elf_Rela*) (ehdrC + shdr[shnum].sh_offset);
Elf_Sym* stab;
char* strtab;
int nent = shdr[shnum].sh_size / sizeof(Elf_Rela);
int target_shndx = shdr[shnum].sh_info;
int symtab_shndx = shdr[shnum].sh_link;
int strtab_shndx = shdr[symtab_shndx].sh_link;
#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
/* This #ifdef only serves to avoid unused-var warnings. */
Elf_Addr targ;
int target_shndx = shdr[shnum].sh_info;
#endif
stab = (Elf_Sym*) (ehdrC + shdr[ symtab_shndx ].sh_offset);
strtab= (char*) (ehdrC + shdr[ strtab_shndx ].sh_offset);
#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
/* This #ifdef only serves to avoid set-but-not-used warnings */
targ = (Elf_Addr) (ehdrC + shdr[ target_shndx ].sh_offset);
#endif
IF_DEBUG(linker,debugBelch( "relocations for section %d using symtab %d\n",
target_shndx, symtab_shndx ));
......@@ -4226,12 +4232,14 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
/* This #ifdef only serves to avoid unused-var warnings. */
Elf_Addr offset = rtab[j].r_offset;
Elf_Addr P = targ + offset;
Elf_Addr A = rtab[j].r_addend;
#endif
#if defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
Elf_Addr value;
#endif
Elf_Addr info = rtab[j].r_info;
Elf_Addr A = rtab[j].r_addend;
Elf_Addr S;
void* S_tmp;
Elf_Addr value;
# if defined(sparc_HOST_ARCH)
Elf_Word* pP = (Elf_Word*)P;
Elf_Word w1, w2;
......@@ -4286,7 +4294,9 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC,
(void*)P, (void*)S, (void*)A ));
/* checkProddableBlock ( oc, (void*)P ); */
#if defined(sparc_HOST_ARCH) || defined(ia64_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
value = S + A;
#endif
switch (ELF_R_TYPE(info)) {
# if defined(sparc_HOST_ARCH)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment