I am learning assembly and low-level programming itself and reading a book about it. It is said there that we can put any data inside the .text section of a
Traditionally, read-only data was placed in the text section for two reasons:
On ELF targets, this scheme was modified a bit. Read-only data is now placed in the new .rodata
section which is like the .text
section except it also cannot be executed, preventing certain attack vectors. The advantages remain.