tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] [PATCH 0/7] Teach tcc -MD/-MF


From: Kirill Smelkov
Subject: [Tinycc-devel] [PATCH 0/7] Teach tcc -MD/-MF
Date: Thu, 17 Jun 2010 00:38:43 +0400

Hello up there.

I'm trying to change gcc to tcc for faster develpment on slow machines, and the
first obstacle that turned out was lack of dependency generation on tcc side.

Please find attached patches that fix it.

Thanks,
Kirill

Kirill Smelkov (7):
  .cvsignore -> .gitignore
  .gitignore += *.o *.a
  chmod a-x i386-gen.c
  tcc: Fix typo in error (it's '%s', not '%s)
  tcc: Always compute default outfile name
  tcc: Draft suppoprt for -MD/-MF options
  tcc -E: Let output_default be <file>.o instead of a.out

 .cvsignore => .gitignore |    2 +
 Changelog                |    4 ++
 TODO                     |    1 -
 libtcc.c                 |    6 +++
 tcc.c                    |   90 ++++++++++++++++++++++++++++++++++------------
 tcc.h                    |    3 ++
 tccpp.c                  |    3 ++
 7 files changed, 85 insertions(+), 24 deletions(-)
 rename .cvsignore => .gitignore (96%)
 mode change 100755 => 100644 i386-gen.c

----------------------------------------

P.S. another obstacle on the road is that tcc generates somewhat 
non-conformant(?)
     Elf files, e.g.

$ cat hello.c
int hello() { return 2; }

$ ./tcc -o hello.so -nostdlib -shared hello.c
$ eu-elflint hello.so
section [ 3] '.bss': alloc flag set but section not in any loaded segment
section [ 4] '.symtab': cannot get symbol 0: invalid section index
section [ 6] '.preinit_array' has wrong type: expected PREINIT_ARRAY, is 
PROGBITS
section [ 6] '.preinit_array' has wrong flags: expected WRITE|ALLOC, is ALLOC
section [ 7] '.init_array' has wrong type: expected INIT_ARRAY, is PROGBITS
section [ 7] '.init_array' has wrong flags: expected WRITE|ALLOC, is ALLOC
section [ 8] '.fini_array' has wrong type: expected FINI_ARRAY, is PROGBITS
section [ 8] '.fini_array' has wrong flags: expected WRITE|ALLOC, is ALLOC
section [ 9] '.dynsym': _GLOBAL_OFFSET_TABLE_ symbol size 4 does not match .got 
section size 12
section [12] '.dynamic': entry 6: REL value must point into loaded segment
section [13] '.plt' is executable in nonexecutable segment 1

... and most important, because of that "cannot get symbol 0" for .symtab, ld
(and whatever from binutils) refuse to understand hello.so as valid elf:

$ size hello.so
size: hello.so: File format not recognized

what in turn means that such .so's can't then be linked by gcc or g++ with the
rest of the project.

I've already tracked that "format not recognized" issue is being related to tcc
emitting completely empty .symtab, but if I understand correctly, elf seems to
say there should be always one first fake UNDEF entry in there, or no .symtab
section at all.

Though slowly investigating this(*), I'm new to Elf internals, so any help is
appreciated.

Thanks again,
Kirill

(*) http://repo.or.cz/w/tinycc/kirr.git/shortlog/refs/heads/x/elflink



reply via email to

[Prev in Thread] Current Thread [Next in Thread]