| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
keep revert (check SHF_ALLOC) only for x86 target and keep a grishka patch for
other targets
|
| |
|
|
| |
The directory is called "arm", not "ARM".
|
| | |
|
| |
|
|
|
|
|
| |
Don't use /usr/local/lib/tcc/libtcc1.a for i386 and x86_64
A $(tccdir)/i386 directory was used to install a libtcc1.a
but only when cross compiling. And no x86_64 directory.
And this directory location was unknown inside tccelf.c
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a strange patch because before this commit a gdb is working well
and after this commit there is exactly the same problem on Linux:
gdb refuses to know "main"
Author: grischka <grischka>
Date: Tue Feb 5 21:18:29 2013 +0100
tccelf: fix debug section relocation
With:
tcc -g hello.c
gdb a.out
b main
gdb refused to know "main" because of broken dwarf info.
|
| |
|
|
|
|
|
| |
This adds some more support for properly transfering some
offsets over the different stages of a relocations life.
Still not at all psABI compliant and DSOs can't yet be generated.
But it runs the testsuite in qemu-arm64.
|
| | |
|
| |
|
|
|
|
|
| |
libtcc.c: Add greloca, a generalisation of greloc that takes an addend.
tcc.h: Add greloca and put_elf_reloca.
tccelf.c: Add put_elf_reloca, a generalisation of put_elf_reloc.
tccgen.c: On x86_64, use greloca instead of greloc in init_putv.
|
| |
|
|
| |
This fixes compilation on (k)FreeBSD.
|
| |
|
|
|
|
|
|
|
| |
- revert to R_X86_64_PC32 for near calls on PE
- revert to s1->section_align set to zero by default
Untested. Compared to release_0_9_26 the pe-image looks back to
normal. There are some differences in dissassembly (r10/r11 usage)
but maybe that's ok.
|
| |
|
|
|
| |
For calls to hidden symbols we don't need a PLT slot, rewrite
the reloc into PC32.
|
| |
|
|
|
| |
The last users of it went away, no use in keeping
this code.
|
| |
|
|
|
|
|
|
|
|
|
| |
Same as with x86_64, disable the runtime_plt_and_got hack
for -run on arm as well. For that we need to handle several
relocations as (potentially) generating PLT slots as well.
Tested with mpfr-3.1.2 and gawk (both using --disable-shared),
there are two resp. five pre-existing problems, so no regressions.
This also works toward enabling real shared libs for arm,
but it's not there yet.
|
| |
|
|
|
|
| |
This makes us use the normal PLT/GOT codepaths also for -run,
which formerly used an on-the-side blob for the jump tables.
For x86_64 only for now, arm coming up.
|
| |
|
|
|
|
|
| |
These relocations are used to express a dependency on a certain
symbol (e.g. for EABIs exception handling to the
__aeabi_unwind_cpp_pr{0,1,2} routines). Just ignore them in
reloc processing.
|
| |
|
|
|
|
|
| |
When output is memory we applied the correct GOT offset for certain
relocations (e.g. _GOT32), but we forgot to actually fill the got
entries with the final symbol values, so unconditionally create relocs
against .got as well.
|
| |
|
|
|
|
|
|
| |
This makes it so that the first PT_LOAD segment covers
ELF and program header and .interp (contained in the same page anyway,
right before the start of the first loaded section). binutils
strip creates invalid output otherwise (which strictly is a binutils
bug, but let's be nice anyway).
|
| |
|
|
|
|
|
|
|
|
| |
This correctly resolves local references to global functions from
shared libs to their PLT slot (instead of directly to the target
symbol), so that interposition works.
This is still not 100% conforming (executables don't export symbols
that are also defined in linked shared libs, as they must), but
normal shared lib situations work.
|
| |
|
|
| |
Initial support for shared libraries on x86-64.
|
| |
|
|
|
| |
Fix commit aa561d70119accb59a17f10f9ba69076fb0ab516 by setting
has_plt_entry once the plt has been created, not before.
|
| |
|
|
|
|
| |
have the undesired side effect of programs compiled with
debug info segfaulting after debug info been striped
more tought must be done here
|
| |
|
|
|
|
| |
valgrind complain with:
Inconsistency detected by ld.so: rtld.c: 1284: dl_main: Assertion `_rtld_local._dl_rtld_map.l_libname' failed!
|
| |
|
|
|
|
|
|
| |
Introduce a new attribute to check the existence of a PLT entry for a
given symbol has the presence of an entry for that symbol in the dynsym
section is not proof that a PLT entry exists.
This fixes commit dc8ea93b13faefb565fb937f8b8c08c40c063549.
|
| |
|
|
| |
tcctest.c with tcc.
|
| |
|
|
|
|
|
| |
Some symbol (such as __gmon_start__ but this one does not matter to tcc)
can have both a R_386_GOT32 and R_386_PLT32 relocation. It is thus not
enough to test if a GOT reloc was already done when deciding whether to
return early from put_got_entry.
|
| |
|
|
| |
On x86 tcc call to function in libtcc1.a to implement va_* functions.
|
| |
|
|
|
|
|
| |
When bound check is enabled, tcc tries to relocate a call to
__bound_init in _init. This means that relocation (in tcc_add_bcheck)
must be done after libtcc1.a (which countains __bound_init) is loaded
but before crtn.o is loaded as this finalize _init.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Call fill_got_entry unconditionally from fill_got so as to avoid
warnings on !x86-64 architectures. This can be done since this code path
is only followed by x86-64 architecture anyway.
|
| | |
|
| | |
|
| |
|
|
|
| |
Introduce for_each_elem to browse relocation entries and symbols of a
section.
|
| |
|
|
| |
This reverts commit 3cbc7a2dccf13b96c572623582d6c54394f98c36.
|
| |
|
|
| |
This reverts commit b5b82df3e388e2565ee424994e3d5041fbf91161.
|
| |
|
|
| |
This reverts commit 8635939b8d902244679cb1a024190fa37a4fed10.
|
| | |
|
| | |
|
| |
|
|
|
| |
Introduce for_each_elem to browse relocation entries and symbols of a
section.
|
| |
|
|
| |
Give ARM assembly mnemonic of PLT entries in put_got_entry
|
| |
|
|
|
|
|
| |
- remove debug printf and commented out code
- remove C++-like comments
- remove whitespace at end of lines
- replace tabs by spaces
|
| | |
|
| |
|
|
| |
This fix commit 32734680cb2a645d48f806edae5a5912e0759a23
|
| |
|
|
|
| |
* set whether soft or hardfloat calling convention is used
* mark ELF file has having an entry point when there is
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Variants __fixsfdi/__fixxfdi are not needed for now because
the value is converted to double always.
Also:
- remove __tcc_fpinit for unix as it seems redundant by the
__setfpucw call in the startup code
- avoid reference to s->runtime_main in cross compilers
- configure: fix --with-libgcc help
- tcctok.h: cleanup
|
| |
|
|
|
|
|
| |
When statically linking, runtime library should be static as well. tcc
could link with libgcc.a but it's in a gcc version specific directory.
Another solution, followed by this patch, is to use libtcc.a when
statically linking, even if USE_LIBGCC was configured.
|
| |
|
|
|
| |
Allow bl -> blx conversion in the case of R_ARM_PC24 relocation with
instruction being an unconditional bl. Also make spacing more uniform.
|