Since 'make undefined global symbol STT_NOTYPE' change win32 code did not build any more.
Unified · Split
| @@ -176,11 +176,13 @@ ST_FUNC void tccelf_end_file(TCCState *s1) · 175 unmodified lines | ||
| 176 | 176 | if (sym->st_shndx == SHN_UNDEF |
| 177 | 177 | && ELFW(ST_BIND)(sym->st_info) == STB_LOCAL) |
| 178 | 178 | sym->st_info = ELFW(ST_INFO)(STB_GLOBAL, ELFW(ST_TYPE)(sym->st_info)); |
| 179 | +#ifndef TCC_TARGET_PE | |
| 179 | 180 | /* An ELF relocatable file should have the types of its undefined global symbol set |
| 180 | 181 | to STT_NOTYPE or it will confuse binutils bfd */ |
| 181 | 182 | if (s1->output_format == TCC_OUTPUT_FORMAT_ELF && s1->output_type == TCC_OUTPUT_OBJ) |
| 182 | 183 | if (sym->st_shndx == SHN_UNDEF && ELFW(ST_BIND)(sym->st_info) == STB_GLOBAL) |
| 183 | 184 | sym->st_info = ELFW(ST_INFO)(STB_GLOBAL, ELFW(ST_TYPE)(STT_NOTYPE)); |
| 185 | +#endif | |
| 184 | 186 | tr[i] = set_elf_sym(s, sym->st_value, sym->st_size, sym->st_info, |
| 185 | 187 | sym->st_other, sym->st_shndx, (char*)s->link->data + sym->st_name); |
| 186 | 188 | } |