bug-binutils
[Top][All Lists]
Advanced

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

ld fails when ld.so is an executable


From: Robert Millan
Subject: ld fails when ld.so is an executable
Date: Sun, 2 May 2004 13:26:43 +0200
User-agent: Mutt/1.5.5.1+cvs20040105i

If you turn ld.so into an executable, ld will fail to link anything
afterwards. According to the ELF standard (section 2-6 in book III),
the dynamic linker can be a shared object or an executable, so binutils
can't assume either.

I'm attaching mkexec.c util and a log with the ld errors. On some kernels
you can't overwrite ld.so directly, so one would do it like:

  cp ld.so /tmp
  mkexec /tmp/ld.so
  mv /tmp/ld.so /lib/

After this hack your ld.so becomes an executable and ld will refuse to link
anything (error log attached).

-- 
Robert Millan

"[..] but the delight and pride of Aule is in the deed of making, and in the
thing made, and neither in possession nor in his own mastery; wherefore he
gives and hoards not, and is free from care, passing ever on to some new work."

 -- J.R.R.T., Ainulindale (Silmarillion)

Attachment: log
Description: Text document

Attachment: mkexec.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]