This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: prior art?


   Date: Thu, 13 May 1999 14:54:00 +1000
   From: Colin McCormack <colin@field.medicine.adelaide.edu.au>

   As I was reading the bfd.info, a strange thought occurred to me:  since bfd 
   will write-out symbol tables, and since (as far as I know) symbol tables and 
   the rest of the executable are mmap()ed into the address space, can bfd modify 
   the symbol table of a running executable by opening it and just ... rewriting 
   it?

It sounds interesting, but unfortunately probably wouldn't work in any
easy fashion.  It is the dynamic linker which handles symbol
resolution for libraries brought in via dlopen.  Whatever structures
it builds up are the ones you would have to modify.  Modifying the
symbol table in memory would not work if the dynamic linker is holding
pointers or counts or such things in its private memory.

If you're running on GNU/Linux, you could get really tricky by using
an alternate dynamic linker for your program, which does what whatever
you need.  After all, the source is available.  I have a vague
recollection that Oracle does something along these lines for other
Unix systems.

Ian

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