lundi 29 juin 2015

How to make duplicate sections in ELF file


I have a requirement where I need to create a duplicate/copy section of .data section.

I've tried creating a dummy section with same size of data section in linker script and copy the contents of data section to the dummy section in the init functions of my ELF image, but that doesn't suit my requirement, as I want the copy/duplicate section to be created along with final ELF image not during the execution of it.

Below is what I wanted in my linker script,

SECTIONS {
    .data : { <data section contents> }
    .dummydata : { <copy of .data section> } 
}

Can anyone help to write the linker script to match above requirement?


Aucun commentaire:

Enregistrer un commentaire