[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Quick question: reliable PIC/non-PIC detection in ELF objects?



I hope you have time to give me some advice on ELF/PIC issues, it's for
lintian, there is a check for wrong pic usage since ages, but it doesn't
work good currently, and since pic-errors are often made, I'd like to
fix it.

What's a reliable way to detect whether or not an ELF object is compiled
with PIC or not, using the output of 'objdump --headers
--private-headers -T'?

Currently, lintian greps for TEXTREL, and takes it as evidence of
non-pic code. According to asuffield, that should work mostly, but can
be off sometimes.

It used to grep for .rel.text and .rela.text, but that reportedly didn't
work.

The main problem is, I cannot build myself a super-small testlibrary...
My current attempt is http://www.wolffelaar.nl/~jeroen/libbaz.tar.gz,
but it doesn't seem to work, at least, it doesn't seem to provoke any
lintian warning.

Do you have any idea how to solve this?

--Jeroen

-- 
Jeroen van Wolffelaar
Jeroen@wolffelaar.nl (also for Jabber & MSN; ICQ: 33944357)
http://Jeroen.A-Eskwadraat.nl



Reply to: