Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[USMP] add missing const specifier for global_const_workspace (#16999)
The `.rodata*` section of any program should not be writable. The missing `const` specifier in `static struct global_const_workspace {...}` leads to the following `readelf -e` output (shortened): ``` Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 001000 009fbe 00 AX 0 0 16 [ 2] .rodata PROGBITS 00009fc0 00afc0 000e50 00 WA 0 0 16 [ 3] .srodata PROGBITS 0000ae10 00be10 000068 08 AM 0 0 8 ... ``` After this fix, the output looks as follows (`AW` -> `A`): ``` Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .text PROGBITS 00000000 001000 00a1be 00 AX 0 0 16 [ 2] .rodata PROGBITS 0000a1c0 00b1c0 000e50 00 A 0 0 16 [ 3] .srodata PROGBITS 0000b010 00c010 000070 00 A 0 0 8 ```
- Loading branch information