diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-06-27 09:14:54 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-06-27 09:14:54 +0200 |
commit | 5d02ca6f28483672f6c9503e5319f0218904fc28 (patch) | |
tree | 14526904e1752ded0769d730de73c6a52b62a823 /asmcomp/amd64 | |
parent | e85ba9c77f680ab574b0836830554c2b4b74091a (diff) | |
download | ocaml-5d02ca6f28483672f6c9503e5319f0218904fc28.tar.gz |
In frame tables, distinguish data pointers from code pointers
Since GPR#247 (stack backtraces aware of inlining) was merged, frame tables contain two kinds of addresses of labels: code labels (as before) and data labels (new, pointing to sub-frames).
On ARM in Thumb mode, the two kinds of pointers must be distinguished, because pointers to Thumb code have the low bit set, and the assembler needs to know whether a label denotes code or data to set the low bit or not.
This commit fixes this problem by splitting the "efa_label" action of record Emitaux.emit_frame_actions into two actions, "efa_code_label" and "efa_data_label". On all ports except ARM, the two actions are identical. On ARM, the actions add the appropriate ".type" declaration.
Tested on ARM-32 and x86-64 only. CI will test the other platforms.
Diffstat (limited to 'asmcomp/amd64')
-rw-r--r-- | asmcomp/amd64/emit.mlp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp index 6d0589139b..594480cf7c 100644 --- a/asmcomp/amd64/emit.mlp +++ b/asmcomp/amd64/emit.mlp @@ -959,7 +959,8 @@ let end_assembly() = let setcnt = ref 0 in emit_frames - { efa_label = (fun l -> D.qword (ConstLabel (emit_label l))); + { efa_code_label = (fun l -> D.qword (ConstLabel (emit_label l))); + efa_data_label = (fun l -> D.qword (ConstLabel (emit_label l))); efa_16 = (fun n -> D.word (const n)); efa_32 = (fun n -> D.long (const_32 n)); efa_word = (fun n -> D.qword (const n)); |