mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
add binary executable output support
This commit is contained in:
parent
bc48cc1edb
commit
2349efa61b
9
tccelf.c
9
tccelf.c
@ -1345,7 +1345,7 @@ int elf_output_file(TCCState *s1, const char *filename)
|
||||
file_type = s1->output_type;
|
||||
s1->nb_errors = 0;
|
||||
|
||||
if (file_type != TCC_OUTPUT_OBJ) {
|
||||
if ((file_type != TCC_OUTPUT_OBJ) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
|
||||
tcc_add_runtime(s1);
|
||||
}
|
||||
|
||||
@ -1359,14 +1359,15 @@ int elf_output_file(TCCState *s1, const char *filename)
|
||||
if (file_type != TCC_OUTPUT_OBJ) {
|
||||
relocate_common_syms();
|
||||
|
||||
tcc_add_linker_symbols(s1);
|
||||
if (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)
|
||||
tcc_add_linker_symbols(s1);
|
||||
|
||||
if (!s1->static_link) {
|
||||
if ((!s1->static_link) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
|
||||
const char *name;
|
||||
int sym_index, index;
|
||||
ElfW(Sym) *esym, *sym_end;
|
||||
|
||||
if (file_type == TCC_OUTPUT_EXE) {
|
||||
if ((file_type == TCC_OUTPUT_EXE) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
|
||||
char *ptr;
|
||||
/* add interpreter section only if executable */
|
||||
interp = new_section(s1, ".interp", SHT_PROGBITS, SHF_ALLOC);
|
||||
|
Loading…
Reference in New Issue
Block a user