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]
Other format: [Raw text]

change a "const int" in an ELF file


Hi,

i work on software for embedded systems for a NEC V850.

Is there a way to change the value of a "const int" in
a certain section in an ELF file to a different value?

As an example, if there's at compile time:

const int __attribute__((special_section)) a_value = 0x12345678;

After the final ELF file is linked together, i'd like to change
the value of "a_value" to a different value.

With "v850-unknown-elf-readelf -s ELF-File | grep a_value" i can
get the address of the value, but how can i access that address
in the ELF-File?

Does anybody know of a way on how to do this?


Best regards,
Torsten.


Background:
Our customer wants us to do a "ROM check".

The source code is compiled, the object files are linked
to an ELF file and from that ELF file an S-Record is
generated which can be flashed into the controller.

I wrote a perl script reads parts of that ELF file,
generates a check sum and then writes that checksum back
to a certain address.  This works, but it is really slow.


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