diff options
-rw-r--r-- | aarch64/TargetPrinter.ml | 5 | ||||
-rw-r--r-- | arm/TargetPrinter.ml | 5 | ||||
-rw-r--r-- | riscV/TargetPrinter.ml | 5 | ||||
-rw-r--r-- | x86/TargetPrinter.ml | 5 |
4 files changed, 16 insertions, 4 deletions
diff --git a/aarch64/TargetPrinter.ml b/aarch64/TargetPrinter.ml index cde5668b..664110d1 100644 --- a/aarch64/TargetPrinter.ml +++ b/aarch64/TargetPrinter.ml @@ -164,7 +164,10 @@ module ELF_System : SYSTEM = | Section_data i | Section_small_data i -> variable_section ~sec:".data" ~bss:".bss" i | Section_const i | Section_small_const i -> - variable_section ~sec:".section .rodata" i + variable_section + ~sec:".section .rodata" + ~reloc:".section .data.rel.ro,\"aw\",@progbits" + i | Section_string sz -> elf_mergeable_string_section sz ".section .rodata" | Section_literal sz -> diff --git a/arm/TargetPrinter.ml b/arm/TargetPrinter.ml index 20ca59d6..b6362ca9 100644 --- a/arm/TargetPrinter.ml +++ b/arm/TargetPrinter.ml @@ -150,7 +150,10 @@ struct | Section_data i | Section_small_data i -> variable_section ~sec:".data" ~bss:".bss" i | Section_const i | Section_small_const i -> - variable_section ~sec:".section .rodata" i + variable_section + ~sec:".section .rodata" + ~reloc:".section .data.rel.ro,\"aw\",%progbits" + i | Section_string _ -> ".section .rodata" | Section_literal _ -> ".text" | Section_jumptable -> ".text" diff --git a/riscV/TargetPrinter.ml b/riscV/TargetPrinter.ml index 373bd1a5..3d258257 100644 --- a/riscV/TargetPrinter.ml +++ b/riscV/TargetPrinter.ml @@ -110,7 +110,10 @@ module Target : TARGET = | Section_data i | Section_small_data i -> variable_section ~sec:".data" ~bss:".bss" i | Section_const i | Section_small_const i -> - variable_section ~sec:".section .rodata" i + variable_section + ~sec:".section .rodata" + ~reloc:".section .data.rel.ro,\"aw\",@progbits" + i | Section_string sz -> elf_mergeable_string_section sz ".section .rodata" | Section_literal sz -> diff --git a/x86/TargetPrinter.ml b/x86/TargetPrinter.ml index dad8d15c..f529a89d 100644 --- a/x86/TargetPrinter.ml +++ b/x86/TargetPrinter.ml @@ -137,7 +137,10 @@ module ELF_System : SYSTEM = | Section_data i | Section_small_data i -> variable_section ~sec:".data" ~bss:".bss" i | Section_const i | Section_small_const i -> - variable_section ~sec:".section .rodata" i + variable_section + ~sec:".section .rodata" + ~reloc:".section .data.rel.ro,\"aw\",@progbits" + i | Section_string sz -> elf_mergeable_string_section sz ".section .rodata" | Section_literal sz -> |