aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/darwin.h
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-05-23 08:25:10 +0100
committerIain Sandoe <iain@sandoe.co.uk>2020-05-23 08:25:46 +0100
commit804254edb48f87d726a1bc9e95af04076c030e35 (patch)
tree8ccd19ce36c16ff8d2b4cb88fa1599d7726945b8 /gcc/config/darwin.h
parent33e09fc5051f70daaad690b8583aab76902cce9c (diff)
downloadgcc-804254edb48f87d726a1bc9e95af04076c030e35.zip
gcc-804254edb48f87d726a1bc9e95af04076c030e35.tar.gz
gcc-804254edb48f87d726a1bc9e95af04076c030e35.tar.bz2
Darwin: Make sanitizer local vars linker-visible.
Another case where we need a linker-visible symbols in order to preserve the ld64 atom model. If these symbols are emitted as 'local' the linker cannot see that they are separate from any global weak entry that precedes them. This will cause the linker to complain that there is (apparently) direct access to such a weak global, preventing it from being replaced. This is a short-term fix for the problem - we need generic handling for relevant cases (that also does not pessimise objects by emitting unnecessary symbols and relocations). gcc/ChangeLog: 2020-05-23 Iain Sandoe <iain@sandoe.co.uk> * config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Make ubsan_{data,type},ASAN symbols linker-visible.
Diffstat (limited to 'gcc/config/darwin.h')
-rw-r--r--gcc/config/darwin.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 27665b3..f528b17 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -808,6 +808,12 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
do { \
if (strcmp ("LC", PREFIX) == 0) \
sprintf (LABEL, "*%s%ld", "lC", (long)(NUM)); \
+ else if (strcmp ("Lubsan_data", PREFIX) == 0) \
+ sprintf (LABEL, "*%s%ld", "lubsan_data", (long)(NUM));\
+ else if (strcmp ("Lubsan_type", PREFIX) == 0) \
+ sprintf (LABEL, "*%s%ld", "lubsan_type", (long)(NUM));\
+ else if (strcmp ("LASAN", PREFIX) == 0) \
+ sprintf (LABEL, "*%s%ld", "lASAN", (long)(NUM));\
else \
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM)); \
} while (0)