I checked ELF spec here http://www.cs.cmu.edu/afs/cs/academic/class/15213-f00/docs/elf.pdf But, there is no difference mentioned.
I am not finding a single document mandating this, but .rodata1 typically comes after everything starting with .rodata. You can look at the linker scripts on your system to verify this (usually /usr/lib/ldscripts/).
This makes some nice things possible, like placing a variable for a checksum in this section. This ensures its behind the remaining read-only stuff, a tool can then calculate the checksum and patch in into the binary.
During runtime you can check your code against the checksum. This sound stupid for a PC, but its common in embedded firmwares. My guess the section was motivated by having a section "outside" of the code produced by a compiler for various reasons, but was never fully documented.
As I know, they're the same.
It's also compiler-dependent. Some compilers will concatenate this 2 sections (and maybe more sections) into ".data".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With