enable pe-output from libtcc (Shmuel Zeigerman)

This commit is contained in:
grischka
2008-05-05 22:39:43 +00:00
parent f2698687fb
commit 96bd8f2b25
2 changed files with 15 additions and 8 deletions

View File

@ -1132,7 +1132,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f,
/* output an ELF file */
/* XXX: suppress unneeded sections */
int tcc_output_file(TCCState *s1, const char *filename)
int elf_output_file(TCCState *s1, const char *filename)
{
Elf32_Ehdr ehdr;
FILE *f;
@ -1788,6 +1788,20 @@ int tcc_output_file(TCCState *s1, const char *filename)
return ret;
}
int tcc_output_file(TCCState *s, const char *filename)
{
int ret;
#ifdef TCC_TARGET_PE
if (s->output_type != TCC_OUTPUT_OBJ) {
ret = pe_output_file(s, filename);
} else
#endif
{
ret = elf_output_file(s, filename);
}
return ret;
}
static void *load_data(int fd, unsigned long file_offset, unsigned long size)
{
void *data;