Fix aliases on 64 bit

Use correct width ELF structure.
master
Michael Matz 2016-09-04 00:19:47 +02:00
parent 9656560f14
commit f2a071e808
2 changed files with 3 additions and 2 deletions

View File

@ -6919,13 +6919,13 @@ static int decl0(int l, int is_for_loop_init)
if (ad.alias_target) {
Section tsec;
Elf32_Sym *esym;
ElfW(Sym) *esym;
Sym *alias_target;
alias_target = sym_find(ad.alias_target);
if (!alias_target || !alias_target->c)
tcc_error("unsupported forward __alias__ attribute");
esym = &((Elf32_Sym *)symtab_section->data)[alias_target->c];
esym = &((ElfW(Sym) *)symtab_section->data)[alias_target->c];
tsec.sh_num = esym->st_shndx;
put_extern_sym2(sym, &tsec, esym->st_value, esym->st_size, 0);
}

View File

@ -2962,6 +2962,7 @@ void __attribute__((weak)) weak_test(void)
printf("weak_asm_v1=%d\n",&weak_asm_v1 != NULL);
printf("weak_asm_v2=%d\n",&weak_asm_v2 != NULL);
printf("weak_asm_v3=%d\n",&weak_asm_v3 != NULL);
printf("some_lib_func=%d\n", &some_lib_func ? some_lib_func() : 0);
}
int __attribute__((weak)) weak_f2() { return 222; }