commit
bba5c8a39a
109 files changed
+14085
No files matched your search
@@ -0,0 +1,15 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in new issue
Block a user