[erlang-questions] Detect beam compilation target
Constantin Rack
constantin@REDACTED
Sun Feb 28 15:00:09 CET 2016
There is a list of all opcodes with comments about the runtime version here:
https://github.com/erlang/otp/blob/master/lib/compiler/src/genop.tab
-Constantin
Am 28.02.2016 um 14:51 schrieb Vlad Dumitrescu:
> Thanks! I was a bit confused that all the files I had looked at had the same value, regardless. My error was that I didn't think that the value depends on the code actually in that module. Checking for example maps.beam gives a different value.
>
> So now I only have to find out if there is a table mapping the max opcode value to the beam runtime version.
>
> best regards,
> Vlad
>
>
> On Sun, Feb 28, 2016 at 1:32 PM, Constantin Rack <constantin@REDACTED> wrote:
> The BEAM format number and the number of the highest opcode are stored in the code chunk:
> https://github.com/erlang/otp/blob/master/erts/emulator/beam/beam_load.c#L1714-L1757
>
> -Constantin
>
>
> Am 28.02.2016 um 12:53 schrieb Vlad Dumitrescu:
>
>> Hi!
>>
>> Is there some information in the beam files that would identify the compatibility with the current runtime, or is it only when trying to execute incompatible code that it is detected?
>>
>> best regards,
>> Vlad
>
More information about the erlang-questions
mailing list