This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Worm and virus free code.


On Sep 28, 2003, Ian Lance Taylor <ian@wasabisystems.com> wrote:

> This could be done at load time on an ELF system.  It doesn't require
> any compiler work.  The relatively easy way is to compile all your
> code with -fPIC, perhaps tweak the linker slightly to preserve all
> relocations in the executable, and tell the loader to randomize the
> load address.

That's called PIE (position-independent executable), and it has been
done before.  GCC supports -fPIE, and recent versions of GNU ld
support -pie.  There are patches for Linux (the kernel) that randomize
the load address of PIEs.  These patches are available in the kernel
that ships with the Fedora Core test2 release.  More information about
this feature is available in the release notes.
http://fedora.redhat.com/

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]