This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libsanitizer merge from upstream r175042


On Wed, Feb 13, 2013 at 04:19:14PM +0100, Jakub Jelinek wrote:
> Here is the patch, works just fine for me here during asan.exp testing.
> You can very easily either install and enable prelink on one of your
> x86_64-linux testing boxes, or just install it and add test that
> will say prelink -r 0x3600000000 some test shared library and then
> just use it in sanitized program (that will also verify that you can mmap
> libraries in that range), or even just write a test that will in a
> non-instrumented ctor with lower priority than asan's priority
> mmap a few pages at 0x3000000000 and close to 0x3fffff0000
> and store some data into those buffers later on in sanitized code.

I forgot you don't even need prelink -r 0x3600000000 for the testing, you
can just link it as
$(CXX) -shared -Wl,-Ttext-segment=0x3600000000 -fPIC -o testlib.so -fsanitize=address testlib.C
So, put some asan tests into the executable, some tests into the shared
library and link the executable against the shared library placed in the
area where prelink allocates addresses to shared libraries.
Perhaps build 3 such libraries, one at 0x3000000000, one somewhere middle
of that range and one close to the end of the range.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]