From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6a) Gecko/20031028 Firebird/0.7+ Description of problem: automount is long running. A good candidate for PIE. I'll attach a patch. Version-Release number of selected component (if applicable): autofs-3.1.7-42 How reproducible: Always Steps to Reproduce: 1.readelf -h /usr/sbin/automount|fgrep Type 2. 3. Actual Results: Type: EXEC (Executable file) Expected Results: Type: DYN (Shared object file) Additional info:
Created attachment 95572 [details] Minimal patch to build as PIE
I've taken your patch and ported it to the 4.1.1 code base. In order to push this upstream, I'd have to have some test to see whether the compiler supports pie. What is the best way to do so?
I don't have an old compiler at hand but running a simple compile test in gcc with -fpie -pie on the command line shoud do. Write a configure test which temporarily adds -fpie to CFLAGS and -pie to LDFLAGS and then compile and link a dummy program. Should be perhaps 10 lines of autoconf code.