Add input files/libs and reloc_output switch to TCCState

files[0], and reloc_outpu will be needed for (upcoming in the next
patch) "compute default outfile name" refactored into libtcc function.

Also, since for symmetry and from libification point of view, it makes
some sense to also put all information about what was given as input to
compilation into TCCState, let's not only put files[0], but all
files and all libraries given explicitely by user.

One point: I've used bitfield for reloc_output & trimmed down
output_type to 8 bits so that TCCState stays the same in size, and also
access to output_type is (hopefully) is not slower.

By the way -- as of today, sizeof(TCCState) on i686-pc-linux-gnu is 2884
bytes...
This commit is contained in:
Kirill Smelkov
2010-06-20 19:49:58 +04:00
parent 66b54af8ea
commit a919a373da
4 changed files with 24 additions and 1 deletions

1
tcc.c
View File

@ -475,6 +475,7 @@ int main(int argc, char **argv)
}
tcc_set_output_type(s, output_type);
s->reloc_output = reloc_output;
/* compile or add each files or library */
for(i = 0; i < nb_files && ret == 0; i++) {