summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm/PrintAsm.ml2
-rw-r--r--cfrontend/CPragmas.ml4
-rw-r--r--ia32/PrintAsm.ml6
-rw-r--r--powerpc/PrintAsm.ml6
4 files changed, 9 insertions, 9 deletions
diff --git a/arm/PrintAsm.ml b/arm/PrintAsm.ml
index 36becdc..6d6296b 100644
--- a/arm/PrintAsm.ml
+++ b/arm/PrintAsm.ml
@@ -116,7 +116,7 @@ let name_of_section_ELF = function
| Section_literal -> ".text"
| Section_jumptable -> ".text"
| Section_user(s, wr, ex) ->
- sprintf ".section %s,\"a%s%s\",%%progbits"
+ sprintf ".section \"%s\",\"a%s%s\",%%progbits"
s (if wr then "w" else "") (if ex then "x" else "")
let section oc sec =
diff --git a/cfrontend/CPragmas.ml b/cfrontend/CPragmas.ml
index 63bd3f9..7bf80bb 100644
--- a/cfrontend/CPragmas.ml
+++ b/cfrontend/CPragmas.ml
@@ -61,8 +61,8 @@ let re_start_pragma_section = Str.regexp "section\\b"
let re_pragma_section = Str.regexp(
"section[ \t]+"
^ "\\([A-Za-z_][A-Za-z_0-9]*\\)[ \t]+" (* class_name *)
-^ "\\(\"[^\"]*\"\\)?[ \t]*" (* istring *)
-^ "\\(\"[^\"]*\"\\)?[ \t]*" (* ustring *)
+^ "\"\\([^\"]*\\)\"?[ \t]*" (* istring *)
+^ "\"\\([^\"]*\\)\"?[ \t]*" (* ustring *)
^ "\\([a-zA-Z-]+\\)?[ \t]*" (* addressing mode *)
^ "\\([RWXON]*\\)" (* access mode *)
)
diff --git a/ia32/PrintAsm.ml b/ia32/PrintAsm.ml
index 096e1e3..80b752d 100644
--- a/ia32/PrintAsm.ml
+++ b/ia32/PrintAsm.ml
@@ -149,7 +149,7 @@ let name_of_section_ELF = function
| Section_literal -> ".section .rodata.cst8,\"aM\",@progbits,8"
| Section_jumptable -> ".text"
| Section_user(s, wr, ex) ->
- sprintf ".section %s,\"a%s%s\",@progbits"
+ sprintf ".section \"%s\",\"a%s%s\",@progbits"
s (if wr then "w" else "") (if ex then "x" else "")
let name_of_section_MacOS = function
@@ -160,7 +160,7 @@ let name_of_section_MacOS = function
| Section_literal -> ".literal8"
| Section_jumptable -> ".const"
| Section_user(s, wr, ex) ->
- sprintf ".section %s, %s, %s"
+ sprintf ".section \"%s\", %s, %s"
(if wr then "__DATA" else "__TEXT") s
(if ex then "regular, pure_instructions" else "regular")
@@ -172,7 +172,7 @@ let name_of_section_Cygwin = function
| Section_literal -> ".section .rdata,\"dr\""
| Section_jumptable -> ".text"
| Section_user(s, wr, ex) ->
- sprintf ".section %s, \"%s\"\n"
+ sprintf ".section \"%s\", \"%s\"\n"
s (if ex then "xr" else if wr then "d" else "dr")
let name_of_section =
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml
index 0b94aaa..9d23ad9 100644
--- a/powerpc/PrintAsm.ml
+++ b/powerpc/PrintAsm.ml
@@ -197,7 +197,7 @@ let name_of_section_MacOS = function
| Section_literal -> ".literal8"
| Section_jumptable -> ".const"
| Section_user(s, wr, ex) ->
- sprintf ".section %s, %s, %s"
+ sprintf ".section \"%s\", %s, %s"
(if wr then "__DATA" else "__TEXT") s
(if ex then "regular, pure_instructions" else "regular")
@@ -211,7 +211,7 @@ let name_of_section_Linux = function
| Section_literal -> ".section .rodata.cst8,\"aM\",@progbits,8"
| Section_jumptable -> ".text"
| Section_user(s, wr, ex) ->
- sprintf ".section %s,\"a%s%s\",@progbits"
+ sprintf ".section \"%s\",\"a%s%s\",@progbits"
s (if wr then "w" else "") (if ex then "x" else "")
let name_of_section_Diab = function
@@ -224,7 +224,7 @@ let name_of_section_Diab = function
| Section_literal -> ".text"
| Section_jumptable -> ".text"
| Section_user(s, wr, ex) ->
- sprintf ".section %s,,%c"
+ sprintf ".section \"%s\",,%c"
s
(match wr, ex with
| true, true -> 'm' (* text+data *)