I have ran through code that use _ attribute _((section(\"name\")). I understand that for gcc compiler this allows you to tell the linker to put the object cre
From a usecase point of view, there are lots of different types of .data
, like:
.vdso
or vsyscall
pages. Or, another example, bootloader and kernel)RIP
-relative addressing, the data must be within that range of your currently executing code)So in the end it's often about attributes (the word here used in a more generic sense than what __attribute__(...)
allows you to state from within gcc sourcecode. Whether another section is needed and/or useful is ... in the eye of the beholder - the system designer, that is.
The availabiltiy of the section
attribute, therefore, allows for flexibility and that is, IMHO, a good thing.