mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-28 12:10:05 +08:00
enable pe-output from libtcc (Shmuel Zeigerman)
This commit is contained in:
parent
f2698687fb
commit
96bd8f2b25
7
tcc.c
7
tcc.c
@ -11094,14 +11094,7 @@ int main(int argc, char **argv)
|
|||||||
} else if (s->output_type == TCC_OUTPUT_MEMORY) {
|
} else if (s->output_type == TCC_OUTPUT_MEMORY) {
|
||||||
ret = tcc_run(s, argc - optind, argv + optind);
|
ret = tcc_run(s, argc - optind, argv + optind);
|
||||||
} else
|
} else
|
||||||
#ifdef TCC_TARGET_PE
|
|
||||||
if (s->output_type != TCC_OUTPUT_OBJ) {
|
|
||||||
ret = pe_output_file(s, outfile);
|
|
||||||
} else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
ret = tcc_output_file(s, outfile) ? 1 : 0;
|
ret = tcc_output_file(s, outfile) ? 1 : 0;
|
||||||
}
|
|
||||||
the_end:
|
the_end:
|
||||||
/* XXX: cannot do it with bound checking because of the malloc hooks */
|
/* XXX: cannot do it with bound checking because of the malloc hooks */
|
||||||
if (!do_bounds_check)
|
if (!do_bounds_check)
|
||||||
|
16
tccelf.c
16
tccelf.c
@ -1132,7 +1132,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f,
|
|||||||
|
|
||||||
/* output an ELF file */
|
/* output an ELF file */
|
||||||
/* XXX: suppress unneeded sections */
|
/* 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;
|
Elf32_Ehdr ehdr;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
@ -1788,6 +1788,20 @@ int tcc_output_file(TCCState *s1, const char *filename)
|
|||||||
return ret;
|
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)
|
static void *load_data(int fd, unsigned long file_offset, unsigned long size)
|
||||||
{
|
{
|
||||||
void *data;
|
void *data;
|
||||||
|
Loading…
Reference in New Issue
Block a user