Use correct width ELF structure.
Unified · Split
| @@ -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 | } |
| @@ -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 | ||
| 2967 | int __attribute__((weak)) weak_f2() { return 222; } | 2968 | int __attribute__((weak)) weak_f2() { return 222; } |