Commit Graph

630 Commits (8bbde91f62291cb0383c2406ae6123be903c944b)
 

Author SHA1 Message Date
grischka 8bbde91f62 tcc_relocate: revert to 0.9.24 behavior 2009-12-19 22:16:23 +01:00
grischka 3db219477a tccrun: new file
factor out -run support
2009-12-19 22:16:22 +01:00
grischka 41e112360f fix uninitialized warnings with 'type.ref' 2009-12-19 22:16:22 +01:00
grischka 3020a4765d tccpe: with -l try also with "lib" prefix
-lfoo searches: foo.def, libfoo.def, foo.dll, libfoo.dll
2009-12-19 22:16:21 +01:00
grischka 94bf4d2c22 tccpe: improve dllimport 2009-12-19 22:16:21 +01:00
grischka 1308e8ebcf integrate x86_64-asm.c into i386-asm.c
Also, disable 16bit support for now as it causes bugs
in 32bit mode.  #define I386_ASM_16 if you want it.
2009-12-19 22:16:20 +01:00
grischka e81569bc70 tcc: add "-Wl,-rpath=path" option (library search path) 2009-12-19 22:16:20 +01:00
grischka dd3d4f7295 x86-64: fix udiv, add cqto instruction 2009-12-19 22:16:19 +01:00
grischka 1445fea582 tccpe: allow linkage to extern symbols from asm 2009-12-19 22:16:18 +01:00
grischka b5e2238483 tccasm: make VT_VOID symbols ST_NOTYPE, elf-wise
This was confusing objdump such that it did not print
disassembly with -d.

Also, put filename as with C compilation
2009-12-19 22:16:18 +01:00
grischka ab4a4ab25e x86-64: in gv(): ignore second register 2009-12-19 22:16:17 +01:00
grischka d79b867d55 win64: adjust for two args with setjmp(buf,ctx) 2009-12-19 22:16:17 +01:00
Christian Jullien 614790dc14 x86-64: Fix Wrong comparisonbetweenpointerandlongcste
main (int argc, char *argv[])
{
    char *p = (char *)0x12345678ABCD000F;
    int res;
    res = (p != (char *)0x12345678ABCD000F);
    return res;
}
2009-12-19 22:16:16 +01:00
grischka e500c9118a i386-asm: fix imul
With imul the 3rd operand defaults to the 2nd on.  The previous
logic left 'op_type[2]' uninitialized which caused the bug to
show up only sometimes.
2009-12-06 17:41:22 +01:00
grischka 56d6abdb3d tccgen: propagate alignment from typedef
Store (part of) the AttributeDef structure in the (int)sym-r
field of the typedef symbol (kludgy).
2009-12-06 17:37:33 +01:00
bobbl c0620c8a00 avoid needless register save when storing structures
When storing structs with a memcpy call in vstore(),
so far a needless entry remaining on the vstack
sometimes resulted in an useless store generated by
save_regs() in gfunc_call() for the memcpy routine.
2009-12-01 17:59:30 +01:00
Bernhard Reutner-Fischer b573072300 document -print-search-dirs
Signed-off-by: aldot <rep.dot.nop@gmail.com>
2009-12-01 17:59:29 +01:00
Bernhard Reutner-Fischer d2e125186f improve handling of --help
Previously ./configure --prefix=/foo --help didn't show the help-text

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-12-01 17:59:29 +01:00
Luigi Rizzo 55cb2170cd solve tccelf problem on FreeBSD
On Sun, Nov 22, 2009 at 05:43:14PM +0100, Luigi Rizzo wrote:
> Hi,
> there is a well known problem with tcc and FreeBSD in the generation
> of elf objects -- see
> http://lists.gnu.org/archive/html/tinycc-devel/2005-07/msg00070.html
>
> Apparently Sergey Lyubka has tried a partial fix to the problem.
> I was wondering if Sergey or someone can post some more detail on
> what needs to be done so we can try to help fixing this issue

I think i have managed to solve the problem and produce
almost valid elf files on FreeBSD. The two patches attached
address a few problems (trying to explain to the
best of my knowledge; i am not very familiar with ELF and
the FreeBSD ELF conventions):

1. ELF file format
  tcc produces an ELF executable which is good for linux but
  not for FreeBSD. It misses the PHDR section which is almost
  mandatory for shared executables, puts in the .dynsym section
  some relocation info that FreeBSD expects to be in .got,
  and expect the relocation sections to be contiguous.

  patch-tccelf.c tries to address the above problem using
  conditional sections (so hopefully can be imported upstream)
  and also adds the ability to override the name of the dynamic
  loader through an environment variable (this is important to
  debug tcc).

2. predefined macros

  patch-libtcc.c adds/fixes some predefined macros when compiling
  on FreeBSD: these are __FreeBSD__ and the usual set of
  __i386__ and __unix__ variants.
  It also sets __INTEL_COMPILER so we can grab the __aligned
  macro from cdefs.h , otherwise many programs would fail

The resulting elf file is still not 100% correct -- if you strip it,
the program will not run (presumably there is some dangling reference).
Other than that, program do seem to run correctly.

It would be nice to integrate these patches in the main repository.
The FreeBSD specific code is in #ifdef so it should not harm
linux users
	cheers
	luigi
2009-12-01 17:59:28 +01:00
grischka 720a32ede4 win32: remove #define alloca from mingw headers 2009-12-01 17:58:39 +01:00
grischka 679f0794f8 win32: explain usage of mingw w32api package 2009-11-30 17:14:41 +01:00
grischka a5279b2c05 tccpe: fclose FILE*
Reported by Martin Ettl (thanks)
2009-11-30 17:14:37 +01:00
grischka a26bf10de3 win64: Use tcc's own assembler
Now that we have it thanks to Mr. Féret
2009-11-21 23:43:38 +01:00
grischka 50055880f9 asm 32/64: replace (long)sym->next by sym->jnext 2009-11-21 23:43:30 +01:00
grischka 1383055b17 x86_64: fix asm 2009-11-14 21:48:37 +01:00
grischka 0a3bcb57f6 fix 32bit asm
The new 16bit code was causing wrong 0x66 prefixes
in 32bit code.

The fix possibly breaks the feature on 16bit asm.
2009-11-14 20:05:22 +01:00
Feret@.(none) c15e37edad Removed binary executable output support
This broke writing executables.
2009-11-13 18:09:02 +01:00
Bernhard Reutner-Fischer 2fdb45f577 fix ambiguity
Signed-off-by: aldot <rep.dot.nop@gmail.com>
2009-11-13 18:09:02 +01:00
Frederic Feret 3065e70630 Fixed compilation error in i386-asm.c 2009-11-13 18:09:01 +01:00
Frederic Feret ae23c46ce2 fixed and added missing file for x86_64 assembly 2009-11-13 18:09:01 +01:00
Frederic Feret b7d7af4fa2 ARM: first support for arm-pe target 2009-11-13 18:09:00 +01:00
Frederic Feret 2f73e42d87 various fixes and new options for PE format 2009-11-13 18:09:00 +01:00
Frederic Feret 526c464504 first support of x86_64 assembly 2009-11-13 18:08:59 +01:00
Frederic Feret 0d768b9713 added 16-bit x86 assembly support 2009-11-13 18:08:58 +01:00
Frederic Feret 2349efa61b add binary executable output support 2009-11-13 18:08:58 +01:00
Daniel Glöckner bc48cc1edb fix sizeof(array + integer)
Previously sizeof would return the size of the array although the
expression is always a plain pointer of 4 (or 8) bytes.
2009-11-13 18:05:15 +01:00
grischka 5b113f3ee3 win32: handle __declspec(dllimport) 2009-11-13 18:04:56 +01:00
grischka dd70d19267 #define __TINYC__ = version-number 2009-11-13 17:11:52 +01:00
Shinichiro Hamaji 5dadff3de5 x86-64: Fix stab debug information.
We need 32bit relocations for code and 64bit for debug info.
Introduce a new macro R_DATA_PTR to distinguish the two usages.
2009-08-24 13:30:03 +02:00
Shinichiro Hamaji 3a1380120d x86-64: change the type of size_t and ptrdiff_t.
size_t and ptrdiff_t should be unsigned long and long, respectively.
2009-08-24 13:30:03 +02:00
grischka 834b782a9c tccpe: fill checksum header field 2009-08-24 13:30:02 +02:00
grischka 569c20f104 tccpp: fix quirk with cached headers and #else
Such as with

    #ifndef FOO_H
    ...
    #else
    ...
    #endif
2009-08-24 13:30:01 +02:00
grischka 1026ca5888 fix "symbol not defined" if symbol has offset 0 2009-08-24 13:30:01 +02:00
grischka d923e652f2 tccpp: avoid double free with macro_ptr_allocated (after errors) 2009-08-24 13:30:00 +02:00
grischka 0d34c2136e tccgen: free inline functions correctly 2009-08-24 13:30:00 +02:00
grischka 697f9e305d win64: fix bat 2009-08-24 13:28:02 +02:00
grischka b08dfb8273 tcc: optionally build using libtcc 2009-07-18 22:08:01 +02:00
grischka f88350b611 fix some warning 2009-07-18 22:07:51 +02:00
grischka c998985c74 cleanup: constify some global data 2009-07-18 22:07:42 +02:00
grischka 94ae3984b0 tccpe: set tcc_lib_path from DLL 2009-07-18 22:07:33 +02:00