mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-22 11:23:27 +08:00
text relocation for netbsd
netbsd does not allow text relocations in text segment. tcc.h: - Add data_ro_section - Fix typo rela.plt tccelf.c: - Add data_ro_section - Make bounds_section/lbounds_section rw - Add GNU_RELRO section for data_ro_section/bounds_section/lbounds_section - Fix relocation for __dso_handle in atexit() tccgen.c: - Use data_ro_section x86_64-gen.c: - Use R_X86_64_PC32 instead of R_X86_64_64 for bounds checking tests/Makefile, tests/tests2/Makefile - Enable dll tests for netbsd
This commit is contained in:
6
tccgen.c
6
tccgen.c
@@ -8120,8 +8120,10 @@ static void decl_initializer_alloc(CType *type, AttributeDef *ad, int r,
|
||||
/* allocate symbol in corresponding section */
|
||||
sec = ad->section;
|
||||
if (!sec) {
|
||||
if (has_init)
|
||||
sec = data_section;
|
||||
if (type->t & VT_CONSTANT)
|
||||
sec = data_ro_section;
|
||||
else if (has_init)
|
||||
sec = data_section;
|
||||
else if (tcc_state->nocommon)
|
||||
sec = bss_section;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user