This is needed for the implementation of __asan_(load|store) in assembly as they need to know what is the beginning of the shadow region.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/asan/asan_rtl.cpp | ||
---|---|---|
40 | do you need an #ifdef here? |
compiler-rt/lib/asan/asan_rtl.cpp | ||
---|---|---|
40 | In case asan_shadow_memory_dynamic_address is used I am not defining SHADOW_OFFSET_STR. The reason is that I will have to have a different assembly code and I didn't want to support it at this time. Because of the '#if defined' it will result in unresolved external if someone is trying to use shared optimized callbacks with asan_shadow_memory_dynamic_address. |
compiler-rt/lib/asan/asan_mapping.h | ||
---|---|---|
187 | It would be nice if we could "string-ifying" the existing constants here? E.g. E.g. #define xstr(s) str(s) #define str(s) #s ... #define SHADOW_OFFSET_STR xstr(SHADOW_OFFSET) If you did something like that you only need to do #define SHADOW_OFFSET_STR once and you could hoist the definition out of the conditional macros. Unfortunately it looks like that wouldn't work for things like kFreeBSD_ShadowOffset32 because those are global constants rather than macros. Maybe there's another way to do it so we can avoid the duplication of constants? |
It would be nice if we could "string-ifying" the existing constants here? E.g.
E.g.
If you did something like that you only need to do #define SHADOW_OFFSET_STR once and you could hoist the definition out of the conditional macros.
Unfortunately it looks like that wouldn't work for things like kFreeBSD_ShadowOffset32 because those are global constants rather than macros.
Maybe there's another way to do it so we can avoid the duplication of constants?