The system ld.bfd
linker supports options such as -z separate-code
and -z noseparate-code
.
- With
-z separate-code
, there are 4 LOAD segments, and its layout isR RE R RW
. - With
-z noseparate-code
, there are 2 LOAD segments, and its layout isRE RW
.
My question is:
Is it possible to implement the above options only using the linker script ? And how to do it ?
My goal is to understand if there is any correlation between benchmark performance and its layout in the memory. In order to do this, I want to create arbitrary LOAD
segments. (e.g. a LOAD segment only contains .fini_array section with a RW permission) Figuring out the above quesiton would be my the first step.
Any suggestion is welcome.