Commit Graph

10 Commits

Author SHA1 Message Date
grischka
e41730f11a - tcc -vv: show cross-libtcc1.a correctly (and more)
(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
2022-09-24 09:46:17 +02:00
herman ten brugge
1de025c13a Check dState instead of do_debug in tccdbg.c
This fixes:
  tcc -g -E

and programs like:
  #pragma comment (option,"-g")
  int main(void) {return 0;}
2022-08-11 09:03:13 +02:00
grischka
ebaa5c81f4 dynamic executables (PIE)
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(-)
2022-07-24 09:44:50 +02:00
herman ten brugge
a4e0f7ef05 Fix bitfield long types for stabs/dwarf
Also made dwarf *leb128 fuctions a litlle bit faster.
2022-05-25 17:04:37 +02:00
herman ten brugge
aaec564a82 Fix bound checking dlcose problem
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
2022-05-19 07:40:14 +02:00
herman ten brugge
0e47167cbe New dwarf update
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.
2022-05-14 15:58:40 +02:00
herman ten brugge
e7396c99b0 Dwarf update
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
2022-05-12 08:15:28 +02:00
herman ten brugge
748e38ad99 Fix stupid typo. 2022-05-10 07:21:49 +02:00
herman ten brugge
9a81e6366b Fix vla type bug for stabs/dwarf
The wrong vla stabs code was accepted by gdb.
The dwarf vla code was fatal.
2022-05-10 07:16:38 +02:00
grischka
2caaff20fb tccdbg.c: new file
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.
2022-05-09 22:37:25 +02:00