[ASan] Enable build with ASan.
authorDenis Khalikov <d.khalikov@partner.samsung.com>
Fri, 8 Sep 2017 14:38:06 +0000 (17:38 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 3 May 2023 10:47:28 +0000 (19:47 +0900)
commit8f368fca9a753481d26fa345f208a3b6352b2838
tree7b89cab9893a3647f4e06a2d432e7c1fd995082f
parent6e33909f78d6411693bcd6c3e7d316705c13915b
[ASan] Enable build with ASan.

This patch enables ASan instrumentation for glibc.

1. Modifies rltd to support calling init for libasan.so
before libc.so. Also changes don't brake backward
compatibility against libpthread.so, because rtld will add
libpthread.so as a first library to initlist.

2. Changes the type of symbol __sched_cpucount from IFUNC
to FUNC, to avoid segfault at the relocation stage.
IFUCN is a spectial type of symbol which allows to call
resolver at the relocation stage (symbol binding),
so resolver instrumented with ASan will cause a segfault.

Change-Id: I99b6e230605801123e3e132f9934c75fae4e6cfa
asan-glibc-gcc-wrapper.py [new file with mode: 0755]
elf/dl-init.c
elf/dl-load.c
elf/dl-support.c
gcc-wrapper.cc [new file with mode: 0644]
packaging/glibc.spec
sysdeps/generic/ldsodefs.h