From 36f7087ae0fe9749b776b7b013ccc0a26a494a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 12 Feb 2017 22:04:36 +0100 Subject: Add extra_chunks option to compile This allow languages such as Elixir and LFE to attach extra chunks to the .beam file without having to parse the beam file after compilation. This commit also cleans up the interface to beam_asm, allowing chunks to be passed from the compiler without a need to change beam_asm API on every new chunk. --- lib/compiler/doc/src/compile.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/compiler/doc') diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index bd488a39a5..e6470b938f 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -418,7 +418,7 @@ module.beam: module.erl \ without module prefix to local or imported functions before trying with auto-imported BIFs. If the BIF is to be called, use the erlang module prefix in the call, not - { no_auto_import,[{F,A}, ...]}.

+ {no_auto_import,[{F,A}, ...]}.

If this option is written in the source code, as a -compile directive, the syntax F/A can be used instead @@ -439,6 +439,15 @@ module.beam: module.erl \

+ {extra_chunks, [{binary(), binary()}]} + +

Pass extra chunks to be stored in the .beam file. + The extra chunks must be a list of tuples with a four byte + binary as chunk name followed by a binary with the chunk contents. + See beam_lib for + more information. +

+

If warnings are turned on (option report_warnings -- cgit v1.2.3