Page MenuHomePhabricator

[sanitizers] Update linker scripts to avoid emutls issues.
Needs ReviewPublic

Authored by hctim on Oct 9 2019, 6:13 PM.



The linker script for ASan contains an entry for _sancov_*. Android TLS symbols are emulated, and so we end up with __sancov_lowest_stack actually ending up with a symbol name of __emutls_v.__sancov_lowest_stack. This symbol is then discarded, as the linker script doesn't consider prefixes.

This patch fixes the above issue, and ensure that any sanitizer build for Android will correctly export symbols, even if they're prefixed with emutls.

Event Timeline

hctim created this revision.Oct 9 2019, 6:13 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 9 2019, 6:13 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript
hctim updated this revision to Diff 224230.Oct 9 2019, 6:34 PM
  • Add test for emutls.
hctim edited the summary of this revision. (Show Details)Oct 9 2019, 6:35 PM
hctim added reviewers: pcc, eugenis.
eugenis added inline comments.Oct 14 2019, 1:41 PM

why is sancov not in this list?
It can be handled in, same as __sanitizer.