mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-04 08:20:12 +08:00
Explain some reloc hackery
just changes a comment; it's not specific to __dso_handle, but general to all hidden defined symbols for shared libraries.
This commit is contained in:
parent
60eac659d4
commit
b117088a91
4
tccelf.c
4
tccelf.c
@ -1048,7 +1048,9 @@ static int prepare_dynamic_rel(TCCState *s1, Section *sr)
|
||||
{
|
||||
ElfW(Sym) *sym = &((ElfW(Sym) *)symtab_section->data)[sym_index];
|
||||
|
||||
/* support __dso_handle in atexit() */
|
||||
/* Hidden defined symbols can and must be resolved locally.
|
||||
We're misusing a PLT32 reloc for this, as that's always
|
||||
resolved to its address even in shared libs. */
|
||||
if (sym->st_shndx != SHN_UNDEF &&
|
||||
ELFW(ST_VISIBILITY)(sym->st_other) == STV_HIDDEN) {
|
||||
rel->r_info = ELFW(R_INFO)(sym_index, R_X86_64_PLT32);
|
||||
|
Loading…
Reference in New Issue
Block a user