| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
When the .size directive was closed with a ';' tcc eat everything after
it up to lineend.
|
| |
|
|
|
| |
Some new opcodes and some aliases: ljmp[wl], prefetch{nta,t0,t1,t2},
bswap[lq], sysretq, swapgs.
|
| |
|
|
|
| |
GAS has alias lgdtq for lgdt (similar for saves and GDT). It doesn't
have the same for LDT.
|
| |
|
|
|
| |
This is like 'r' but only accepts the eight legacy regs. Currently
that's the same as 'r' because we don't support the high ones.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Given this code:
struct __attribute__((...)) Name {...};
TCC was eating "Name", hence generating an anonymous struct.
It also didn't apply any packed attributes to the parsed
members. Both fixed. The testcase also contains a case
that isn't yet handled by TCC (under a BROKEN #define).
|
| | |
|
| |
|
|
|
| |
This is meant to be a (sign-extended) 32bit constant (possibly
symbolic). We don't do any checks and simply regard it as "i".
|
| |
|
|
|
| |
This really should be handled implicitly in the preprocessor,
but for now this is enough.
|
| |
|
|
|
|
| |
A 'P' template modifier should avoid adding a '$' to literal
arguments. Also accept the numbered r8+ registers in an inline
asm clobber list (ignoring them for now).
|
| |
|
|
| |
Those should use long or long long type, and generate a 64bit reloc.
|
| |
|
|
| |
Implement some more opcodes, syscall, sysret, lfence, mfence, sfence.
|
| |
|
|
|
| |
I.e. implement < > <= >= == !=. Comparisons are signed and result
is -1 if true, 0 if false.
|
| |
|
|
|
| |
The x86-64 target has 64bit relocs, and hence can accept
generic expressions for '.quad'.
|
| |
|
|
|
| |
'p' is conservatively the same as 'r' and 'P' as template
modifier can be ignored in TCC.
|
| | |
|
| |
|
|
|
|
| |
In particular subtracting a defined symbol from current section
makes the value PC relative, and .org accepts symbolic expressions
as well, if the symbol is from the current section.
|
| | |
|
| |
|
|
|
|
|
| |
struct S { /*nothing*/; int a; };
is an acceptable struct declaration, there may be stray semicolons
in the member list.
|
| |
|
|
| |
In inline extended asm '%q1' refers to the 64bit register of operand 1.
|
| |
|
|
|
| |
attribute(section("one" "two")) should be accepted (the section
name being "onetwo"), it's normal string concatenation.
|
| |
|
|
|
|
|
| |
These are preprocessor cmdline arguments, but even in GCC they
aren't specified but rather left as being subject to changes.
Nobody should use them, but let's to a half-assed attempt
at accepting them.
|
| |
|
|
|
|
|
| |
The linux fixdep parse is very stupid and only recognizes
a target token when ':' is part of it. A space is permitted
in Makefile syntax, but it's easier to change our emitter
than all fixdep parsers out there.
|
| | |
|
| |
|
|
|
|
| |
This option includes a file as if '#include "file"' is the first
line of compiled files. It's processed after all -D/-U options
and is processed per input file.
|
| |
|
|
|
|
|
|
| |
gen_inline_functions uses the macro facilities of the preprocessor,
which would interact when macros would still be defined in a
different pre-processor implementation I'm working on.
So always free defines before generating inline functions, they
are all macro expanded already.
|
| |
|
|
|
|
|
| |
When tokens in macro definitions need cstr_buf inside get_tok_str,
the second might overwrite the first (happens when tokens are
multi-character non-identifiers, see testcase) in macro_is_equal,
failing to diagnose a difference. Use a real local buffer.
|
| |
|
|
|
| |
When benchmarking preprocessing of multiple files we need to
free the defines like when not benchmarking.
|
| |
|
|
|
| |
Those two insn types are nicer to handle as operand types, because
the pressure for bits on instr_type is higher than for operands.
|
| | |
|
| |
|
|
|
|
| |
Now we can express prefixes with 0x0fxx opcodes we can correct the
movq mem64->xmm opcode, and restrict the movq xmm->mem64 movq to
not invalidly accept mmx.
|
| |
|
|
|
| |
Now that we can store prefixes even for 0x0fXX opcodes we can remove
the OPC_D16 bit.
|
| |
|
|
|
| |
Inserting random registers in the middle of the 8-blocks
breaks register assignment.
|
| |
|
|
|
|
|
|
|
| |
Disjoint instruction types don't need to be a bit field, so
introduce an enumeration (3 bits). Also the 0x0f prefix can
be expressed by a bit, doesn't need a byte in the opcode field.
That enables to encode further prefixes still in 16 bit.
To not have to touch all insns do some macro fiddling filtering
out a 0x0f byte in the second position.
|
| |
|
|
|
| |
The old place (tccasm.c) didn't have access to the variables anymore
and was ifdefed out. Move it to i386-asm.c.
|
| |
|
|
|
|
|
|
| |
In particular those that are extensions of existing mmx (or sse1)
instructions by a simple 0x66 prefix. There's one caveat for
x86-64: as we don't yet correctly handle the 0xf3 prefix
the movq mem64->xmm is wrong (tested in asmtest.S). Needs
some refactoring of the instr_type member.
|
| |
|
|
|
| |
Also remove bitfield test from tcctest.c because gcc
versions don't agree among each other.
|
| |
|
|
|
|
|
|
|
|
| |
- generate and use SYM@PLT for plt addresses
- get rid of patch_dynsym_undef hack (no idea what it did on FreeBSD)
- use sym_attrs instead of symtab_to_dynsym
- special case for function pointers into .so on i386
- libtcc_test: test tcc_add_symbol with data object
- move target specicic code to *-link.c files
- add R_XXX_RELATIVE (needed for PE)
|
| |
|
|
|
|
|
| |
MSVC does not support array designator so cannot compile source using
relocs_info. This commit replace the relocs_info array into a set of
functions, each returning the value given by a given field of the struct
reloc_info.
|
| |
|
|
|
|
| |
Last use for pltoff_addend field of relocs_info array was removed in
commit 25927df3b75c5ce2b64ab8acdcc5974b4e1c89c1. It is now useless so
this commit removes it and all initialization related to it.
|
| |
|
|
|
| |
Fill in relocs_info table for C67 and fix R_C60_NUM value to really be
greater than all relocation values known to TCC.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
i386 target does not have PC relative loads. Its ABI therefore require
ebx register to points to the GOT when executing a PLT entry. This means
that PLT entry cannot be used transparently, the compiler needs to
expect execution of a PLT entry to be able to use one, that is a PLT
entry should only be created if the relocation explicitely asks for it
(eg. R_386_PLT32).
This patch creates a new target macro PCRELATIVE_DLLPLT to indicate
whether a target can do a PC relative load in PLT entry when building a
dynamic library. Executable do not normally pose a problem because they
are loaded at a fixed address and thus the absolute address of GOT can
be used.
Note that in such a case, if the compiler does not use a PLT aware
relocation for external access then the code relocation will fall on the
dynamic loader since there is no PLT entry to relocate too.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
C standard specifies that array should be declared with a non null size
or with * for standard array. Declaration of relocs_info in tcc.h was
not respecting this rule. This commit add a R_NUM macro that maps to the
R_<ARCH>_NUM macros and declare relocs_info using it. This commit also
moves all linker-related macros from <arch>-gen.c files to <arch>-link.c
ones.
|