Files
faumaray bba5c8a39a initial commit
Signed-off-by: Aleksey Selihov <faumaray@gmail.com>
2026-05-22 02:40:32 +03:00

16 lines
438 B
C

// Accesses an extern global variable via R_X86_64_REX_GOTPCRELX.
// Tests that the GOT data slot + R_X86_64_GLOB_DAT flow works:
// the synthesized ELF declares the symbol as SHN_UNDEF in .dynsym,
// emits a GLOB_DAT reloc in .rela.dyn, and RTLD resolves it from
// the caller's global symbol table.
extern int the_answer;
int get_the_answer(void) {
return the_answer;
}
int double_the_answer(void) {
return the_answer * 2;
}