aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
Commit message (Collapse)AuthorAgeFilesLines
* Only use blx if availableThomas Preud'homme2012-10-161-8/+11
| | | | | | | | Introduce ARM version for the target architecture in order to determine if blx instruction can be used or not. Availability of blx instruction allows for more scenarii supported in R_ARM_CALL relocation. It should also be useful when introducing support for the R_ARM_THM_CALL relocation.
* Fix R_ARM_CALL when target fonction is ThumbThomas Preud'homme2012-10-101-4/+12
| | | | | | With R_ARM_CALL, if target function is to be entered in Thumb mode, the relocation is supposed to transform bl in blx. This is not the case actually so this commit is there to fix it.
* Support for R_ARM_[THM_]MOV{W,T}_ABS[_NC} relocsThomas Preud'homme2012-10-101-0/+32
| | | | | | | | | Add support for relocations R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS as well as their Thumb2 counterpart R_ARM_THM_MOVW_ABS_NC and R_ARM_THM_MOVT_ABS. These are encountered with gcc when compiling for armv7-a and a data is loaded in a register, either in arm or Thumb2 mode. The first half of the data is loaded with movw ; the second half is loaded with movt.
* Fix R_ARM_REL32 relocationThomas Preud'homme2012-07-091-0/+1
| | | | Add missing break in the code handling R_ARM_REL32 relocation.
* tccelf.c: Add R_ARM_REL32 relocationThomas Preud'homme2012-06-051-0/+2
|
* libtcc: tcc_get_symbol uses the TCCState parametergrischka2012-04-181-2/+2
| | | | | This allows using tcc_get_symbol on some other than the current TCCState. (Suggested by David Mertens)
* tcc_realloc: auto "memory full" errorgrischka2012-04-181-2/+0
|
* Fix assumption of 32bit long on portions of ElfAndrew Mulbrook2012-03-031-8/+9
| | | | | | | | | Modify tcc to accept convert full 64bits of specified text section when converting on Win64. Write high bytes to the elf section address as well. This allows creation of elf binaries located in offsets using full 64 bit addresses. Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
* Revert "Multiple fixes for 64 bit sections"Andrew Mulbrook2012-03-031-13/+8
| | | | This reverts commit d7a7c3769d0a1dcb8400258cd8adf78a8566de61.
* Multiple fixes for 64 bit sectionsmob2012-02-261-8/+13
| | | | | | | | | | | | | | | This changeset attempts to fix a few problems when giving using the high 32bits of a 64bit section offset. There are likely more issues (or perhaps regressions) lurking in the muck here. In general, this moves a few data type declarations to use uplong. Also, add support for 64bit mingw32 building under cygwin. Because native types are used for 64 bit offsets, this won't fix challenges with cross compiling from 32bit -> 64bit. Tested under cygwin, against binary compiled with -Wl,-Ttext=0xffffff8000000000 Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
* Fix linkage of named file in loader script.Thomas Preud'homme2012-01-041-44/+9
| | | | | | Remove the previous logic to link a named file with a loader script by using tcc_add_dll instead. Hence, all files can be linked, not only files ending in .so/.def.
* Fix problem with PLT and GOT relocs on armel.Daniel Glöckner2011-08-121-3/+12
| | | | | | | | | | | | | TinyCC fails to link correctly to libraries when both R_ARM_PLT32 and R_ARM_GOT32 relocation to a same symbol exist (see http://lists.nongnu.org/archive/html/tinycc-devel/2010-05/msg00032.html for more details). The patch marks all undefined weak symbols found in external libraries as strong. The value of all remaining weak symbols is set to zero just before the section is output. Note by Thomas Preud'homme: it's been 2 months in Debian without any new bug report, hence commiting.
* rename error/warning -> tcc_(error/warning)grischka2011-08-111-24/+24
|
* libtcc: minor adjustmentsgrischka2011-08-111-13/+1
| | | | | | | | | | | | | | | | | - use {B} to substitute tcc_lih_path (instead of \b) - expand CONFIG_TCC_CRTPREFIX in CONFIG_TCC_LIBPATHS which fixes duplicate CONFIG_SYSROOT. - put default CONFIG_SYSROOT ("") into tcc.h - remove hack from commit db6fcce78f4d8ea25036dd6643e9fa83d8e52e5a because $(tccdir)/include is already in sysincludes - configure: error out for unrecognized options. - win32/build-tcc.bat: put libtcc into base dir where it will find lib/include automatically, and build libtcc_test example.
* libtcc: support more than one crtprefixgrischka2011-08-061-1/+1
| | | | Looks like gcc has that. Oh Deer!
* configure: add switches to set search pathsgrischka2011-08-061-36/+16
| | | | | | | | | | | | | | | | | | | --sysincludepaths=.. specify system include paths, colon separated" Sets CONFIG_TCC_SYSINCLUDEPATHS --libpaths=... specify system library paths, colon separated" Sets CONFIG_TCC_LIBPATHS --crtprefix=... specify location of crt?.o" Sets CONFIG_TCC_CRTPREFIX --elfinterp=... specify elf interpreter" Sets CONFIG_TCC_ELFINTERP Also the CONFIG_TCC_XXX were renamed to make them look more consistent. Also move the elf_interp definitions to tcc.h.
* Revert "Add a --multiarch-triplet switch to configure"Thomas Preud'homme2011-08-031-8/+2
| | | | This reverts commit 76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.
* Add a --multiarch-triplet switch to configureThomas Preud'homme2011-08-021-2/+8
| | | | | | | | | | | | | Add a --multiarch-triplet switch to configure. The switch will allow files to be search for each default path in path/<triplet> and then path. Default paths handled that way: - CONFIG_TCC_SYSINCLUDE_PATHS - CONFIG_TCC_LIBPATH - path to crt*.o - path to libgcc_s.so.1 Path missing: elf interpreter path (will be handled in another commit)
* Set CONFIG_TCC_CRT_PREFIX relative to CONFIG_SYSROOTThomas Preud'homme2011-08-011-1/+1
| | | | | Set CONFIG_TCC_CRT_PREFIX relative to CONFIG_SYSROOT for consistency with CONFIG_TCC_LDDIR.
* Accept colon separated paths with -L and -Igrischka2011-08-011-10/+3
| | | | | | | | | | | | | | | | | | This allows passing colon separated paths to tcc_add_library_path tcc_add_sysinclude_path tcc_add_include_path Also there are new configure variables CONFIG_TCC_LIBPATH CONFIG_TCC_SYSINCLUDE_PATHS which define the lib/sysinclude paths all in one and can be overridden from configure/make For TCC_TARGET_PE semicolons (;) are used as separators Also, \b in the path string is replaced by s->tcc_lib_path (CONFIG_TCCDIR rsp. -B option)
* tccpe: cleanup ELFW() macros etc.grischka2011-07-141-16/+1
|
* Use CONFIG_TCC_LDDIR for ld.so on all linux archsThomas Preud'homme2011-07-081-4/+4
|
* Remove unused variablesThomas Preud'homme2011-05-161-3/+6
| | | | | Remove unused local variables and declare them conditionally when they are used only on some architectures.
* Improve weak aliases handlingThomas Preud'homme2011-05-161-17/+19
| | | | | | * Include only the STB_GLOBAL alias symbol in .dynsym section * Stop the loop when STB_GLOBAL symbol is found * Reword / simplify comment
* tccelf: allow multiply defined weak symbolsJoe Soroka2011-03-071-0/+2
|
* unlink outfile firstChangming Xu2011-03-031-0/+1
| | | | file mode problem if the outfile already exists
* One more fix for tcc -runShinichiro Hamaji2010-12-281-1/+2
| | | | We don't need r_addend for addresses in PLT.
* Fix for the previous commit.Shinichiro Hamaji2010-12-281-2/+3
| | | | R_X86_64_PLT32 for .so doesn't need DLL relocation.
* Handle r_addend and R_X86_64_PLT32 properly.Shinichiro Hamaji2010-12-281-7/+6
| | | | | | | | | - 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.
* tccelf/tcccoff: fix some type conversion warningsgrischka2010-12-041-6/+6
|
* x86_64: finish biarch path fixupHenry Kroll III2010-11-251-1/+1
|
* x86_64: fix --with-libgcc and simplify biarch pathsHenry Kroll III2010-11-251-6/+2
|
* Add support for __FreeBSD_kernel__ kernelThomas Preud'homme2010-09-101-6/+8
| | | | | Add support for kfreebsd-i386 and kfreebsd-amd64 Debian arch with thanks to Pierre Chifflier <chifflier@cpe.fr>.
* Add support for indirect functions as externals.Thomas Preud'homme2010-08-091-6/+8
| | | | Add link support to use indirect functions defined in external modules
* don't discard SHT_((PRE)INIT|FINI)_ARRAY sectionsDaniel Glöckner2010-05-151-0/+3
|
* ARM: add support for R_ARM_V4BXDaniel Glöckner2010-05-151-1/+10
|
* ARM: allow jumps > 32MB on -runDaniel Glöckner2010-05-141-0/+16
| | | | This is needed to reach tinycc's PLT from the compiled program.
* Don't load libtcc1 on arch where it doesn't existThomas Preud'homme2010-05-011-3/+7
| | | | | | | 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.
* Link alias symbols togetherThomas Preud'homme2010-05-011-0/+20
| | | | | | | | 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.
* Replace malloc+strcpy by tcc_strdup in ld_load_file_listThomas Preud'homme2010-04-201-9/+3
|
* Fix "already done" test in libname_to_filename()Thomas Preud'homme2010-04-201-1/+1
| | | | if "(libname == '\0')" should be instead "if (libname != '\0')"
* Clean changes introduced by 47abdbdThomas Preud'homme2010-04-201-66/+86
| | | | | | | | | | | | * 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
* Better handle ld scriptsThomas Preud'homme2010-04-151-3/+113
| | | | | | | * 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
* tccelf: fix warninggrischka2010-04-131-0/+2
|
* fill got table for static linkingAli Gholami Rudi2010-02-051-0/+44
|
* Added patch to detect and use the paths for 64bit libraries asNikos Mavrogiannopoulos2010-01-281-0/+4
| | | | used by CentOS (affects X86_64 only).
* Recognize -Wl,-BsymbolicDetlef Riekenberg2010-01-261-0/+4
| | | | | | | | | | | | | | | 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
* x86-64: use uplong for symbol valuesgrischka2010-01-141-12/+10
|
* build from multiple objects: fix other targetsgrischka2009-12-201-1/+1
|
* allow tcc be build from separate objectsgrischka2009-12-201-35/+27
| | | | If you want that, run: make NOTALLINONE=1