tinycc/tests/tests2/148_linker_symbols.expect
grischka 64552b3faa
Some checks failed
build and test / test-x86_64-linux (push) Has been cancelled
build and test / test-x86_64-osx (push) Has been cancelled
build and test / test-aarch64-osx (push) Has been cancelled
build and test / test-x86_64-win32 (push) Has been cancelled
build and test / test-i386-win32 (push) Has been cancelled
build and test / test-arm64-win32 (push) Has been cancelled
build and test / test-armv7-linux (push) Has been cancelled
build and test / test-aarch64-linux (push) Has been cancelled
build and test / test-riscv64-linux (push) Has been cancelled
build and test / test-i386-linux (push) Has been cancelled
tccelf: rework linker_sym (_end/end) logic
- tcc_add_linker_symbols():
    don't add for dlls
- bind_exe_dynsym():
    update _end symbol when done
    allow data definition in the .so override a bss symbol
    in the exe. For example
       exe: int x;
       .so: int x = 123;
- set_elf_sym():
    cannot compare section numbers with symbols from dlls
  tcc_load_obj():
    return -1 from symbol conflict errors

tests/tests2/148_linker_symbols:
- use only one file
- make it print useful output rather than just "2 errors."
  In general, the tests2 setup with .expect files is meant
  to compare text output.  For example:
      printf("val = %d\n", val);

  .expect file can be generated or refreshed using
       make tests2.nnn+
   or in order to force generation with tcc itself
       make tests2.nnn+ GEN-CC='$(GEN-TCC)'

tccgen.c:
- __attribute__((section(...))) : set section type/flags
    according to first usage
- fix bcheck bounds for -fcommon
2026-08-05 17:41:23 +02:00

43 lines
794 B
Plaintext

--- TEST 1 ---
linker symbols test
1 (etext == _etext)
1 (edata == _edata)
1 (end == _end)
1 (check_linker_symbols() == 0)
--- TEST 2 ---
DSO linker symbols test
1 (p[0] == _etext)
1 (p[1] == _edata)
1 (p[2] == _end)
--- TEST 3 ---
user definition test
1 (etext() + edata() + end() == 6)
--- TEST 4 ---
end copy relocation test
1 (end == _end)
1 ((unsigned long)end >= data_end)
1 (copy_reloc_data[256] == 42)
--- TEST 5 ---
linker boundary test
1 (linker_test_bss > linker_test_data)
1 (etext == _etext)
1 (edata == _edata)
1 (end == _end)
1 (etext >= text_addr)
1 (edata >= data_end)
1 (end >= bss_end)
1 (linker_test_data[22] == 42)
1 (linker_test_bss[256] == 42)
--- TEST 6 ---
DSO initialized data test
1 (end == 7)
1 (eight == 8)
1 (nine == 9)
1 (sum == 24)