History

add binary executable output support

Frederic Feret committed 17 years ago

Commit 2349efa1 parent bc48cc11 file · +5 −4Browse files

Unified · Split

tccelf.c+5−4
@@ -1345,7 +1345,7 @@ int elf_output_file(TCCState *s1, const char *filename) · 1344 unmodified lines
13451345 file_type = s1->output_type;
13461346 s1->nb_errors = 0;
13471347
1348− if (file_type != TCC_OUTPUT_OBJ) {
1348+ if ((file_type != TCC_OUTPUT_OBJ) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
13491349 tcc_add_runtime(s1);
13501350 }
13511351
@@ -1359,14 +1359,15 @@ int elf_output_file(TCCState *s1, const char *filename) · 7 unmodified lines
13591359 if (file_type != TCC_OUTPUT_OBJ) {
13601360 relocate_common_syms();
13611361
1362− tcc_add_linker_symbols(s1);
1362+ if (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)
1363+ tcc_add_linker_symbols(s1);
13631364
1364− if (!s1->static_link) {
1365+ if ((!s1->static_link) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
13651366 const char *name;
13661367 int sym_index, index;
13671368 ElfW(Sym) *esym, *sym_end;
13681369
1369− if (file_type == TCC_OUTPUT_EXE) {
1370+ if ((file_type == TCC_OUTPUT_EXE) && (s1->output_type != TCC_OUTPUT_FORMAT_BINARY)) {
13701371 char *ptr;
13711372 /* add interpreter section only if executable */
13721373 interp = new_section(s1, ".interp", SHT_PROGBITS, SHF_ALLOC);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t