(As long as it is in the default install location and was not
moved elsewhere into the library search path manually)
Also:
- libtcc.c:
- error1(): show correct line with "In file included from ..."
- support "tcc -Bxxx -vv"
- tcc_new()/tcc_compile(): Don't create elf sections for tcc -E
- tccdbg.c:
- tcc -E -g : revert 1de025c13a
Let's keep things simple, everybody understands 'do_debug'
and dState is set by tcov too (but no debug sections).
- tccgen.c:
- avoid the extra parameter for gind()
(from c3e3a07ed4)
- vla func params: use skip_or_save_block() and enable
VT_LVAL (see 313855c232)
- cleanup nocode_wanted a bit
- tccelf.c:
- tccelf_end_file(): don't try to translate zero-sym relocs
(seems to happen with asm "jmp 0x1000")
- version_add(): do not make "ld-linux.so" DT_NEEDED
Allows to create dynamic executables, using the code path
for TCC_OUTPUT_DLL but add an .interp header (plus a FLAGS_1
entry in the dynamic section to make 'readelf' say "PIE")
Introduces TCC_OUTPUT_DYN as alias for TCC_OUTPUT_DLL.
There is no runtime option, only one to configure:
./configure --config-pie
100 insertions(+), 76 deletions(-)
The main problem is that an application called dlclose and then
had a bound checking problem. The list of dll's in tccrun was
not updated an caused a crash.
Also fixed some minor other things.
tccdbg.c:
- Allow filenames like ../file.c
- Rewrite DWARF_ABBREV_MEMBER_BF/DWARF_ABBREV_MEMBER a bit
tccelf.c:
- Add call to __bt_exit. This solves problem when dlclose is called
tccrun.c:
- Rewrite rt_printline_dwarf a litlle to use opcode_length correctly
- Do not stop at DW_LNE_end_sequence
- Fix DW_LNE_set_address again. Works now in *bsd.
lib/bt-exe.c lib/bt-dll.c:
- Add __bt_exit/__bound_exit_dll
lib/bcheck.c:
- Add __bound_exit_dll
tccdbg.c
- Fix typo in dwarf_file. This resulted in not finding correct include
files.
tccrun.c:
- Change FILE_TABLE_SIZE to 512. Some files use very large includes.
- When a dll containted more then 1 file the pc was not calculated
correctly.
Some small updates in tccdbg.c found by checking readelf output from
gcc/clang.
- Change encoding type bool type
- Fix enum signed/unsigned
- Do not hash anon symbol
- Use correct filename/line_number for global variables
- Fix compiler warning in tcc_get_dwarf_info
- Use unsigned long long for array indexes
- Display correct first line of function in gdb
Better avoid global variables, at least in new code.
tccdbg.c hopefully should be logically identical to the
former parts in tccgen/elf.c (s1 tccstate added in some
places)
tccelf.c: dwarf linkage seems special per dwarf rather
than special per target.