Commit Graph

3109 Commits

Author SHA1 Message Date
Danny Milosavljevic
b85c3e1595
arm-asm: Add b, bl, bx, blx 2021-01-03 02:34:11 +01:00
Danny Milosavljevic
3b1f06c3b2
arm-asm: Add and, eor, sub, rsb, add, adc, sbc, rsc, tst, teq, cmp, cmn, orr, mov, bic, mvn 2021-01-03 02:34:11 +01:00
Danny Milosavljevic
c7682dd9aa
arm-asm: Add ldr, ldrb, str, strb 2021-01-03 02:34:11 +01:00
Danny Milosavljevic
632b213756
arm-asm: Add stmda, ldmda, stm, ldm, stmia, ldmia, stmdb, ldmdb, stmib, ldmib 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
82663d33bb
arm-asm: Add mul, mla, smull, umull, smlal, umlal 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
c4e13c1ef9
arm-asm: Add clz, sxtb, sxth, uxtb, uxth 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
c9e0c2a543
arm-asm: Add swi 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
b495959e4b
arm-asm: Add push, pop
Also edited tcctok.h to not redefine push, pop
2021-01-03 02:34:10 +01:00
Danny Milosavljevic
c5428cd19c
arm-asm: Add parse_operand, Operand
tccpp: Allow '#' token to reach the assembler.
2021-01-03 02:34:10 +01:00
Danny Milosavljevic
a16678e9f3
arm-asm: Add wfe, wfi 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
aaf052391d
arm-asm: Add nop 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
9d302620c2
arm-asm: Remove asm_error 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
b10824dcdc
arm-asm: Update copyright header 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
f88ded6c2d
arm-asm: Implement asm_parse_regvar and asm_clobber 2021-01-03 02:34:10 +01:00
Danny Milosavljevic
4a6fb47b8d
arm-asm: Publish g, gen_le16, gen_le32 in tcc.h 2021-01-03 02:34:10 +01:00
herman ten brugge
3221cc4a5a Align next section after gnu_ro to pagesize
To allow remapping the ro section the next section must start
on a new page.
2021-01-02 15:17:25 +01:00
Christian Jullien
b147a37c23 Remove useless [u]intN_t definitions from stddef.h 2021-01-02 11:23:26 +01:00
Christian Jullien
c9fe8fe470 Yet another int64_t/uint64_t definition fix. For wine this time. 2021-01-02 05:58:46 +01:00
herman ten brugge
2633c30fb4 riscv64 update
implement load/store to constant address
use VT_LLONG instead of VT_PTR in register passing
fix bound checking problem with small structs
enable riscv tests in tests/tcctest.c and tests/tests2/119_random_stuff.c
2021-01-01 20:36:57 +01:00
Christian Jullien
9a2a05ba1e *BSD: fix extra #endif 2021-01-01 16:01:03 +01:00
Christian Jullien
33257c6439 *BSD: protect against incompatible redefinitions of int64_t/uint64_t. 2021-01-01 08:50:13 +01:00
herman ten brugge
8db839cc85 FreeBSD32 struct return 2020-12-31 06:48:14 +01:00
herman ten brugge
9d49883895 update clang warning 2020-12-31 06:39:56 +01:00
grischka
ea82d0826d tccpp: cleanup target-os defines
moved target_machine defines to the <target>-gen.c files.

Also:
- c2str.c moved into conftest.c
- tccdefs.h ; defined(__TINYC__) && !defined(_LOCORE) removed
  (in tinycc __TINYC__ is always defined and _LO... is never.)
- stddef.h : too many #ifdefs, removed
- tccgen.c:stabs: support win32 long doubles aka doubles.
- win32: math.h/tcc_libm.h: fix pointer mismatch in modfl
- tccpp.c: increment include_stack_ptr after the file was
  actually found otherwise it would print
  "in file included from <itself>: file not found..."
2020-12-31 02:03:31 +01:00
Michael Matz
d784b28877 No need for sm_table.size entry
the sh_size input member is reliable, we don't need to duplicate
it in the section mapping info.
2020-12-31 01:21:52 +01:00
Michael Matz
b117088a91 Explain some reloc hackery
just changes a comment; it's not specific to __dso_handle, but general
to all hidden defined symbols for shared libraries.
2020-12-31 00:54:00 +01:00
Michael Matz
60eac659d4 fix cross compiler compilation
{l,}bounds_section is only conditionally defined.
2020-12-31 00:16:23 +01:00
herman ten brugge
cf10c1db66 Fix clang warnings 2020-12-30 19:12:05 +01:00
herman ten brugge
85b6efbf0c Real fix include SHT_NOTE sections everywhere
Thinko in last commit
2020-12-30 18:23:43 +01:00
herman ten brugge
766bd82032 Fix include SHT_NOTE sections everywhere 2020-12-30 16:24:15 +01:00
herman ten brugge
0821940e26 text relocation for netbsd
netbsd does not allow text relocations in text segment.

tcc.h:
- Add data_ro_section
- Fix typo rela.plt

tccelf.c:
- Add data_ro_section
- Make bounds_section/lbounds_section rw
- Add GNU_RELRO section for data_ro_section/bounds_section/lbounds_section
- Fix relocation for __dso_handle in atexit()

tccgen.c:
- Use data_ro_section

x86_64-gen.c:
- Use R_X86_64_PC32 instead of R_X86_64_64 for bounds checking

tests/Makefile, tests/tests2/Makefile
- Enable dll tests for netbsd
2020-12-30 14:08:06 +01:00
Christian Jullien
c13c434383 Fix warnings detected by clang when compiling c2str. 2020-12-30 08:57:30 +01:00
Michael Matz
cc40305a12 Fix errors with parallel make
seen when doing 'make -j i386-tcc tcc', as explained in the comment.
2020-12-25 02:10:43 +01:00
Christian Jullien
16ed67537c NetBSD: longjmp(jmp_buf, 0) is not supported. 2020-12-24 09:29:25 +01:00
Christian Jullien
b9db7c90ee NetBSD: arm64 prevent use of __asm. 2020-12-24 07:31:52 +01:00
Michael Matz
1032e7175a ELF: include SHT_NOTE sections everywhere
... not just on the BSDs.  Sometimes e.g. .note.ABI-tag is allocated
and other sections might contain relocations referring to symbols in
them.  TCC doesn't do any special processing to them, like merging
or somesuch, it just pastes them all together in normal link-editing
behaviour.

(Seen on a recent openSUSE with glibc 2.32, when the crt1.o file
contains debug information)
2020-12-24 07:01:04 +01:00
Christian Jullien
b56099aeb4 NetBSD: arm64 fix int64_t/uint64_t definitions. 2020-12-24 06:50:48 +01:00
Christian Jullien
63e29113ab NetBSD: arm64 requires at least gcc 4.1 to work 2020-12-23 20:52:25 +01:00
Christian Jullien
ba61c7bb37 NetBSD: arm64 is curiously detected as evbarm. Struct uc_mcontext is once again different. 2020-12-23 20:08:26 +01:00
herman ten brugge
f7d2d04d96 Fix include/tccdefs.h
Remove __amd64__ for FreeBD (32 bits version did not work any more)
Add __APPLE__ at HAVE MALLOC_REDIR so bound checking works on apple
2020-12-22 18:53:29 +01:00
herman ten brugge
0352c41a07 add R_ARM_GOT_PREL for clang 2020-12-22 14:31:09 +01:00
grischka
9f6b65230a include/tccdefs.h: moved and use it
tcc_define_symbol(): now only for -D on command line
include/tccdefs.h: converted to strings and compiled into
the tcc executable.  Can be disabled with
    ./configure --config-predefs=no
In this case include/tccdefs.h is loaded at runtime.  This is
default for other build-methods (build-tcc.bat) also (to avoid
some complexity).

Also:
- lib/Makefile: fix typo
- tcc.h : avoid _strto(u)i64 (for TCC on WIN98/2K)
- tccpp.h:cstr_printf() : workaround incompatible vsnprintf's
  (generally faster too)
2020-12-22 11:06:19 +01:00
herman ten brugge
8f8abcc756 more bsd updates
This implements support for FreeBSD on aarch64
This partial implements support on FreeBSD(32). This still needs fixing
i386_gen.c because small structures on this target are passed in registers.

Add aligned 16 to __int128_t for FreeBSD
Support __i386__ on FreeBSD/NetBSD
Fix testcase 115 on FreeBSD/NetBSD
Disable testcase 116 on *BSD* because TLS_FUNC/TLS_VAR not set in bcheck.c
Remove FreeBSD/FreeBSD_kernel code from tccelf.c
2020-12-22 07:02:47 +01:00
Christian Jullien
888f4fd982 FreeBSD (aarch64): fix relocation error. 2020-12-22 05:52:45 +01:00
Christian Jullien
6cc87629b4 NetBSD: define __amd64__ which is sometimes used in headers. 2020-12-20 14:19:55 +01:00
Christian Jullien
a493fbb1fa *BSD: mention all BSD ports in README. 2020-12-20 10:50:07 +01:00
Christian Jullien
d4a4ee798b FreeBSD: Fix multiple ctype inline definitions 2020-12-20 09:45:16 +01:00
Christian Jullien
ac470a49d5 *BSD: Add few __builtin_ math missing definitions. 2020-12-20 07:26:04 +01:00
herman ten brugge
7eea5306e9 rename testcase 106 2020-12-19 21:02:44 +01:00
herman ten brugge
7f898abb82 bsd update
Fix crtbegin/crtend
Use dlsym on all bsd targets
Check .eh_frame on all bsd targets
Disable test3 on FreeBSD and NetBSD and use test1 instead because dlsym not working (WIP)
Disable dlltest and 113_btdll on NetBSD because text relocations are not allowed
Disable 115_bound_setjmp on NetBSD because longjmp is renamed into __longjmp14
2020-12-19 20:55:52 +01:00