advanced-microcode-patching / shiva

A custom ELF linker/loader for installing ET_REL binary patches at runtime
Other
146 stars 13 forks source link

Handling ELF TLS variables #7

Open elfmaster opened 1 year ago

elfmaster commented 1 year ago

__thread int var;

Such variables are for thread local storage in concurrent applications. These types of variables require special handling to patch. Depending on the TLS model used:

global-dynamic. local-dynamic. initial-exec. local-exec.

global-dynamic/local-dynamic sometimes utilize TLSDESC relocations. -- Handling all TLS model scenarios is a decent undertaking but not too difficult. Will require some extra deepdives into ELF TLS again.