This is the mail archive of the binutils@sources.redhat.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: How to modify the value of variable in .o ELF (linux)


Hi Roman,

: I need to be able to modify the value (not NAME) of the variable in
: a .o file (in my case - linux kernel module) without recompiling
: the .o.
: 
: I am sure that this can be accomplished with BDF library but I
: am trying to find a tool that will do it for me (like objcopy)
: and avoid writing code :-)

You may be able to do this with the linker command line switch
--defsym.  (I have not tried this out, but it is worth a shot).

Failing that you may be able to define the symbol, and its new value,
in a custom linker script.

Cheers
	Nick



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