FS#26434 - [namcap] Warn on TEXTREL in shared object.

Attached to Project: Arch Linux
Opened by Sverd Johnsen (sjohnsen) - Friday, 14 October 2011, 01:11 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Saturday, 04 February 2012, 13:17 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

When TEXTREL is found in DSO, namcap should print a warning.
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Saturday, 04 February 2012, 13:17 GMT
Reason for closing:  Implemented
Additional comments about closing:  featured in 3.2.2
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 15 October 2011, 10:33 GMT
Please explain with more details the goal of such a warning.
Comment by Sverd Johnsen (sjohnsen) - Saturday, 15 October 2011, 14:09 GMT
The goal is to warn about text relocations in shared libraries or PIE binaries - indicating problems with the build system or upstream code.

They are pretty rare these days but it's a nice to have warning when namcap should be "full featured". The most commonly causes are ASM code that is not PIC ending up a DSO, or the build system not applying compiler flags correctly at times. See "Conclusion" for a quick WHY: http://www.akkadia.org/drepper/textrelocs.html or search around in http://www.akkadia.org/drepper/dsohowto.pdf

readelf -d a.out | grep TEXTREL
0x00000016 (TEXTREL) 0x0
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 15 October 2011, 14:19 GMT
Thank you, I'll guess such a warning can be implemented easily using the eu-findtextrel utility as specified in the above link.
Comment by Sverd Johnsen (sjohnsen) - Saturday, 15 October 2011, 14:21 GMT
readelf will do just fine. (I edited it in my above post.)
Comment by Rémy Oudompheng (remyoudompheng) - Saturday, 15 October 2011, 15:02 GMT
I'd prefer relying on an exit code rather than parsing a program's output, which is almost always a pain or a bad idea.

Loading...