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>
14 lines
254 B
C
14 lines
254 B
C
extern char etext[], _etext[];
|
|
extern char edata[], _edata[];
|
|
extern char end[], _end[];
|
|
|
|
int check_linker_symbols(void)
|
|
{
|
|
int errors = 0;
|
|
|
|
errors += etext != _etext;
|
|
errors += edata != _edata;
|
|
errors += end != _end;
|
|
return errors;
|
|
}
|