It's clear from the content of the test that it cannot test what it's intended to test unless the file it passes to dlopen it an ET_EXEC. So if you want to build the test itself as PIE, then you need to change it to open some file other than itself.