I know
- In assembly language source code, I can use directives
.text,.data, or.rodatato declare sections. - In linker script, I can use following commands to generate sections into ELF file
.text : { *(.text) } .data : { *(.data) }
- If using readelf, I can see sections
.text,.data, etc.
My questions are:
- Can I add a custom section
.mysectionto ELF by asm code and ld script? - If I add custom section and build project as a shared library, can linux dynamic linker/loader deal with my shared lib correctly? Or I have to modify dyn-linker/loader?
Appreciate any suggesions.
.sectiondirective when creating your own named sections. - Ross Ridge