aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2005-06-17 21:31:04 +0000
committerbellard <bellard>2005-06-17 21:31:04 +0000
commitb78d3ff1dca891bc2f377c5a9f71cc142808afa2 (patch)
tree8d9e3f14fbccf6709e0192380ef8b7f9aa5e0609
parentf6db2edc40adc87779190fbc2e9bd58fbf81f835 (diff)
downloadtinycc-b78d3ff1dca891bc2f377c5a9f71cc142808afa2.tar.gz
tinycc-b78d3ff1dca891bc2f377c5a9f71cc142808afa2.tar.bz2
the PE linker code is not ready for -fleading-underscore support
-rw-r--r--tccpe.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tccpe.c b/tccpe.c
index f1bd0f7..5911296 100644
--- a/tccpe.c
+++ b/tccpe.c
@@ -383,10 +383,13 @@ ST char pe_type;
ST int pe_find_import(TCCState * s1, const char *symbol, char *ret)
{
int sym_index = find_elf_sym(s1->dynsymtab_section, symbol);
- if (0 == sym_index &&
- !memcmp(symbol, "__imp__", 7)) {
- /* Hm, maybe it's '_symbol' instead of '__imp__symbol' */
- symbol += 6;
+ if (0 == sym_index) {
+ /* Hm, maybe it's '_symbol' instead of 'symbol' or '__imp__symbol' */
+ char buffer[100];
+ 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);
}
if (ret)