tccrun: 'tcc_relocate()' twice no longer supported

- abort with notice when tcc_relocate() is called with the
  former two-step method
- support backtrace & bcheck not only with tcc_run() but also
  for directly called functions from tcc_get_symbol(); enable
  witn 'tcc_set_options("-bt/-b");'
- move struct rt_context and debug sections into compiled code
  for TCC_OUTPUT_MEMORY also
- protect access (g_rc) with semaphore
Also:
- add armv7/aarch4/riscv64 github tests (qemu emulated)
- win32/build-tcc.bat: build cross compiler only with -x
This commit is contained in:
grischka
2024-02-11 13:13:13 +01:00
parent 7b9f19eaab
commit a7cd016d71
13 changed files with 420 additions and 299 deletions

View File

@@ -416,12 +416,15 @@ ST_FUNC void tcc_debug_new(TCCState *s1)
int shf = 0;
if (!s1->dState)
s1->dState = tcc_mallocz(sizeof *s1->dState);
#ifdef CONFIG_TCC_BACKTRACE
/* include stab info with standalone backtrace support */
if (s1->do_backtrace
&& (s1->output_type & (TCC_OUTPUT_EXE | TCC_OUTPUT_DLL)))
if (s1->do_debug && s1->output_type == TCC_OUTPUT_MEMORY)
s1->do_backtrace = 1;
if (s1->do_backtrace)
shf = SHF_ALLOC | SHF_WRITE; // SHF_WRITE needed for musl/SELINUX
#endif
if (s1->dwarf) {
s1->dwlo = s1->nb_sections;
dwarf_info_section =