Status: New
Owner: ----
CC: [email protected]
Labels: Type-Defect Priority-Medium OpSys-All

New 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

Test case by Ryan Govostes:
================================================
int undefined();

int (*unused)() = undefined;

int main() {
        return 0;
}
================================================

$ clang++ t.cc -o t -Wl,--gc-sections -ffunction-sections -fsanitize=address -mllvm -asan-globals=0 $ clang++ t.cc -o t -Wl,--gc-sections -ffunction-sections -fsanitize=address -mllvm -asan-globals=1
/tmp/t-1710b5.o:(.data+0x0): undefined reference to `undefined()'
clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)

This happens because ASan creates a per-module global array that references every global in the module irrespective of its usage.

--
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/groups/opt_out.

Reply via email to