History

Fix aliases on 64 bit

Use correct width ELF structure.

Michael Matz committed 10 years ago

Commit f2a071e1 parent 96565602 files · +3 −2Browse files

Unified · Split

2 files
  1. tccgen.c +2 −2
  2. tests/tcctest.c +1 −0
tccgen.c+2−2
@@ -6919,13 +6919,13 @@ static int decl0(int l, int is_for_loop_init) · 6918 unmodified lines
6919 6919
6920 if (ad.alias_target) {6920 if (ad.alias_target) {
6921 Section tsec;6921 Section tsec;
6922 Elf32_Sym *esym;6922 ElfW(Sym) *esym;
6923 Sym *alias_target;6923 Sym *alias_target;
6924 6924
6925 alias_target = sym_find(ad.alias_target);6925 alias_target = sym_find(ad.alias_target);
6926 if (!alias_target || !alias_target->c)6926 if (!alias_target || !alias_target->c)
6927 tcc_error("unsupported forward __alias__ attribute");6927 tcc_error("unsupported forward __alias__ attribute");
6928 esym = &((Elf32_Sym *)symtab_section->data)[alias_target->c];6928 esym = &((ElfW(Sym) *)symtab_section->data)[alias_target->c];
6929 tsec.sh_num = esym->st_shndx;6929 tsec.sh_num = esym->st_shndx;
6930 put_extern_sym2(sym, &tsec, esym->st_value, esym->st_size, 0);6930 put_extern_sym2(sym, &tsec, esym->st_value, esym->st_size, 0);
6931 }6931 }
tests/tcctest.c+1−0
@@ -2962,6 +2962,7 @@ void __attribute__((weak)) weak_test(void) · 2961 unmodified lines
2962 printf("weak_asm_v1=%d\n",&weak_asm_v1 != NULL);2962 printf("weak_asm_v1=%d\n",&weak_asm_v1 != NULL);
2963 printf("weak_asm_v2=%d\n",&weak_asm_v2 != NULL);2963 printf("weak_asm_v2=%d\n",&weak_asm_v2 != NULL);
2964 printf("weak_asm_v3=%d\n",&weak_asm_v3 != NULL);2964 printf("weak_asm_v3=%d\n",&weak_asm_v3 != NULL);
2965 printf("some_lib_func=%d\n", &some_lib_func ? some_lib_func() : 0);
2965}2966}
2966 2967
2967int __attribute__((weak)) weak_f2() { return 222; }2968int __attribute__((weak)) weak_f2() { return 222; }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t