History

the PE linker code is not ready for -fleading-underscore support

bellard committed 21 years ago

Commit b78d3ff1 parent f6db2ed1 file · +7 −4Browse files

Unified · Split

tccpe.c+7−4
@@ -383,10 +383,13 @@ ST char pe_type; · 382 unmodified lines
383383 ST int pe_find_import(TCCState * s1, const char *symbol, char *ret)
384384 {
385385 int sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
386− if (0 == sym_index &&
387− !memcmp(symbol, "__imp__", 7)) {
388− /* Hm, maybe it's '_symbol' instead of '__imp__symbol' */
389− symbol += 6;
386+ if (0 == sym_index) {
387+ /* Hm, maybe it's '_symbol' instead of 'symbol' or '__imp__symbol' */
388+ char buffer[100];
389+ if (0 == memcmp(symbol, "__imp__", 7))
390+ symbol += 6;
391+ else
392+ buffer[0] = '_', strcpy(buffer + 1, symbol), symbol = buffer;
390393 sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
391394 }
392395 if (ret)

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