History

Fix STT_NOTYPE problem on win32

Since 'make undefined global symbol STT_NOTYPE' change win32 code did not build any more.

herman ten brugge committed 3 years ago

Commit fc8c0181 parent ded713e1 file · +2 −0Browse files

Unified · Split

tccelf.c+2−0
@@ -176,11 +176,13 @@ ST_FUNC void tccelf_end_file(TCCState *s1) · 175 unmodified lines
176176 if (sym->st_shndx == SHN_UNDEF
177177 && ELFW(ST_BIND)(sym->st_info) == STB_LOCAL)
178178 sym->st_info = ELFW(ST_INFO)(STB_GLOBAL, ELFW(ST_TYPE)(sym->st_info));
179+#ifndef TCC_TARGET_PE
179180 /* An ELF relocatable file should have the types of its undefined global symbol set
180181 to STT_NOTYPE or it will confuse binutils bfd */
181182 if (s1->output_format == TCC_OUTPUT_FORMAT_ELF && s1->output_type == TCC_OUTPUT_OBJ)
182183 if (sym->st_shndx == SHN_UNDEF && ELFW(ST_BIND)(sym->st_info) == STB_GLOBAL)
183184 sym->st_info = ELFW(ST_INFO)(STB_GLOBAL, ELFW(ST_TYPE)(STT_NOTYPE));
185+#endif
184186 tr[i] = set_elf_sym(s, sym->st_value, sym->st_size, sym->st_info,
185187 sym->st_other, sym->st_shndx, (char*)s->link->data + sym->st_name);
186188 }

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