mirror of
git://repo.or.cz/tinycc.git
synced 2026-11-04 21:26:36 +08:00
The traditional boundary symbols were recorded against the canonical .text, .data and .bss sections before dynamic binding and final layout. Separately named allocatable sections and copy-relocated data could therefore fall outside the advertised ranges. Track definitions synthesized by the linker and finalize them from the ordered loadable sections. Refresh both regular and dynamic symbol tables, and give the plain etext, edata and end names PROVIDE semantics on every ELF target while preserving user definitions. Cover archive references, overrides, copy relocations and independently named text/data/bss sections. Reported-by: Richard Wheeler <18647491+PythonWillRule@users.noreply.github.com>
15 lines
403 B
C
15 lines
403 B
C
void __attribute__((section(".text.linker_test"), noinline, used))
|
|
linker_test_text(void)
|
|
{
|
|
}
|
|
|
|
unsigned char linker_test_data[23]
|
|
__attribute__((section(".data.linker_test"), used)) = { 1 };
|
|
|
|
unsigned char linker_test_bss[257]
|
|
__attribute__((section(".bss.linker_test"), used));
|
|
|
|
/* set_global_sym replaces BSS/common definitions of these symbols. */
|
|
unsigned char _etext;
|
|
unsigned char _edata;
|