| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Remove unused local variables and declare them conditionally when they
are used only on some architectures.
|
| |
|
|
|
|
| |
* Include only the STB_GLOBAL alias symbol in .dynsym section
* Stop the loop when STB_GLOBAL symbol is found
* Reword / simplify comment
|
| | |
|
| |
|
|
| |
file mode problem if the outfile already exists
|
| |
|
|
| |
We don't need r_addend for addresses in PLT.
|
| |
|
|
| |
R_X86_64_PLT32 for .so doesn't need DLL relocation.
|
| |
|
|
|
|
|
|
|
| |
- r_addend should be applied for PLT entries as well
- R_X86_64_PLT32 should be handled just like R_X86_64_PC32
- spec says GLOB_DAT and JUMP_SLOT don't need r_addend (not tested)
http://www.x86-64.org/documentation/abi.pdf
Now we can -run ELF objects generated by GCC.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Add support for kfreebsd-i386 and kfreebsd-amd64 Debian arch with
thanks to Pierre Chifflier <chifflier@cpe.fr>.
|
| |
|
|
| |
Add link support to use indirect functions defined in external modules
|
| | |
|
| | |
|
| |
|
|
| |
This is needed to reach tinycc's PLT from the compiled program.
|
| |
|
|
|
|
|
| |
ARM architecture doesn't have any libtcc1 implementation but tcc load
libtcc1.a in all case. This patch add a conditional preprocessor
instruction to load libtcc1.a only when there is an implementation for
the target architecture.
|
| |
|
|
|
|
|
|
| |
Make sure alias symbols resolve to the same address in program .bss or .data
section. This ensure for example that if a program reference environ (via an
extern char **environ declaration) and the libc change its value via the
__environ alias after the R_ARCH_COPY relocation have been performed, then
the program will see the new value.
|
| | |
|
| |
|
|
| |
if "(libname == '\0')" should be instead "if (libname != '\0')"
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Replace the save/load_buffer_state by a dynarray approach:
- Filename and libname are added to a dynarray when first encountered
- Load repeatedly the files in the dynarray until no new undefined
symbol are encountered
* Replace snprintf by sprintf in libname_to_filename
* Use tcc_fileextension in filename_to_libname
* Introduce a tcc_strcpy_part fonction to copy only a subset of a
string
* Move new_undef_syms declaration from tcc.h to tccelf.c
|
| |
|
|
|
|
|
| |
* search file from INPUT and GROUP commands in the library path in
addition to the current directory
* handle libraries specified by -lfoo options
* Search lib in GROUP command repeatedly
|
| | |
|
| | |
|
| |
|
|
| |
used by CentOS (affects X86_64 only).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without -Bsymbolic, a symbol/function in a *.so can be overridden
by a symbol/function in the main module.
That is the default search order, but not supported by tcc.
With -Bsymbolic, the linker tries to resolve a symbol/function in
the current module first.
The loader in tcc implements this search order.
We do not distinguish -Bsymbolic and -Bsymbolic-function
--
By by ... Detlef
|
| | |
|
| | |
|
| |
|
|
| |
If you want that, run: make NOTALLINONE=1
|
| |
|
|
| |
exception handler borrowed from k1w1. Thanks.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
This broke writing executables.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This prepares for x86_64 where we need the vector
for far jumps. Also, resolve DLL symbols in place
|
| |
|
|
| |
... such as 'int baz;' in two files at the same time
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Size of the extra buffer is too large for now.
|
| | |
|
| |
|
|
| |
Now, we concat buffers before relocation. So this only happens when users try creating >2GB binary.
|