stand: only compute symidx on x86

We only use symidx on x86, so only compute it on x86 to fix a set but
not used warning on aarch64.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D38246
This commit is contained in:
Warner Losh 2023-02-02 13:03:10 -07:00
parent a9e0629719
commit ce18e19394

View File

@ -56,7 +56,10 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
__ELF_WORD_SIZE == 64
Elf64_Addr *where, val;
Elf_Addr addend, addr;
Elf_Size rtype, symidx;
Elf_Size rtype;
#if defined(__amd64__) || defined(__i386__)
Elf_Size symidx;
#endif
const Elf_Rel *rel;
const Elf_Rela *rela;
@ -67,7 +70,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
dataaddr);
addend = 0;
rtype = ELF_R_TYPE(rel->r_info);
#if defined(__amd64__) || defined(__i386__)
symidx = ELF_R_SYM(rel->r_info);
#endif
addend = 0;
break;
case ELF_RELOC_RELA:
@ -76,7 +81,9 @@ __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr, const void *reldata,
dataaddr);
addend = rela->r_addend;
rtype = ELF_R_TYPE(rela->r_info);
#if defined(__amd64__) || defined(__i386__)
symidx = ELF_R_SYM(rela->r_info);
#endif
break;
default:
return (EINVAL);