mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
the PE linker code is not ready for -fleading-underscore support
This commit is contained in:
parent
f6db2edc40
commit
b78d3ff1dc
11
tccpe.c
11
tccpe.c
@ -383,10 +383,13 @@ ST char pe_type;
|
|||||||
ST int pe_find_import(TCCState * s1, const char *symbol, char *ret)
|
ST int pe_find_import(TCCState * s1, const char *symbol, char *ret)
|
||||||
{
|
{
|
||||||
int sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
|
int sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
|
||||||
if (0 == sym_index &&
|
if (0 == sym_index) {
|
||||||
!memcmp(symbol, "__imp__", 7)) {
|
/* Hm, maybe it's '_symbol' instead of 'symbol' or '__imp__symbol' */
|
||||||
/* Hm, maybe it's '_symbol' instead of '__imp__symbol' */
|
char buffer[100];
|
||||||
symbol += 6;
|
if (0 == memcmp(symbol, "__imp__", 7))
|
||||||
|
symbol += 6;
|
||||||
|
else
|
||||||
|
buffer[0] = '_', strcpy(buffer + 1, symbol), symbol = buffer;
|
||||||
sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
|
sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
|
||||||
}
|
}
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user