Comment #5 on issue 260 by [email protected]: ASan breaks dead
stripping (-ffunction-sections/-Wl,-gc-section on Linux, -dead_strip on OSX)
http://code.google.com/p/address-sanitizer/issues/detail?id=260
Progress report.
I've an almost working implementation of globals instrumentation on Linux.
The main problem with the approach suggested above (keeping the descriptors
in a single data section) is that it still doesn't work with --gc-sections,
because that flag naturally removes only dead sections and can't carve a
single descriptor pointing to a dead global out of the section. E.g. for
the example given in #2 the data section .data.BBB won't be removed,
because it's referenced by the live section containing all the global
descriptors.
To deal with this we need to make the following changes:
1. Emit the descriptor for each global foo into its own _asan_globals.foo
section
2. Put a pointer to that descriptor at the end of global's redzone.
3. Link with a linker script that merges all the _asan_globals.* sections
into a single _asan_globals one.
The second step is required because otherwise the linker will garbage
collect the descriptors of all globals. The drawback of this approach is
that it'll move all zero-initialized globals from .bss to .data, where
they'll occupy actual disk space.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.