[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>
Tue, 5 Mar 2024 08:51:07 +0000 (17:51 +0900)
commit384dbb58b06e08b89e5c0c9464536589b337f849
tree0225c09840660b5bf14355d4e675d013f36ed7a7
parentfb0b58578c77a65fcecc84a47c0004030bdc267b
[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