Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changes/03-other/1365-asm-jasmin-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- The assembly output of the compiler features an `.ident` directive including
the version of the compiler
([PR #1365](https://github.com/jasmin-lang/jasmin/pull/1365)).
4 changes: 3 additions & 1 deletion compiler/src/AsmTargetBuilder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,13 @@ module Make(Target : AsmTarget) : S
let functions_head = pp_functions_decl asm.asm_funcs in
let functions_body = pp_functions asm.asm_funcs in
let data_segment = pp_data_segment asm.asm_globs asm.asm_glob_names in
let compiler_ident = Header (".ident", [Format.asprintf "\"%s\"" Glob_options.version_string]) in
let stack_note_segment =
if is_target_system_macos () then [] else [
Header (".section", [ "\".note.GNU-stack\""; "\"\""; "%progbits" ]);
]
in
headers @ functions_head @ functions_body @ data_segment @ stack_note_segment
headers @ functions_head @ functions_body @ data_segment @
compiler_ident :: stack_note_segment

end