dyninst/testsuite

Memory tests fail in PIC mode

hainest opened this issue · 3 comments

Building commit e5ec233. The main error is

relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output

See gist for output details, ld, and gcc versions. This is the first time I've had the build completely fail. This my first time building on 'cayenne.cs.wisc.edu', though.

I know what's going on, but I don't know how to fix this.

File test6LS-x86_64.s is a test written by in assembly, which apparently is not PIC. In newer linux systems, PIE is the default. So, when you compile the test suite, the linker will not be able to link our non-PIC hand written assembly with other PIC objects.

Two things to do to fix the problem: (1) when we compiler non-pic tests, we need to force the compiler to generate non-pic code. (2) disable pic tests for such human written disassembly or provide a pic version of test6LS-x86_64.s.

A third thing I just find: currently when we compile pic tests, the generated tests are still non-pic ...

mem_tests were removed in #41. We need to fix them and get them back into the test suite for 10.1.

This was seen previously in #23.