From 812aa2ba19124ae869ce465bac69aab9a4ff547a Mon Sep 17 00:00:00 2001
From: Reid Spencer
There are two types of signatures for LLVM bytecode: uncompressed and +compressed as shown in the table below.
Type | -Field Description | +Uncompressed | +Compressed |
---|---|---|---|
char | Constant "l" (0x6C) | +Constant "l" (0x6C) | |
char | Constant "l" (0x6C) | +Constant "l" (0x6C) | |
char | Constant "v" (0x76) | +Constant "v" (0x76) | |
char | Constant "m" (0x6D) | +Constant "c" (0x63) | +|
char | +N/A | +'0'=null,'1'=gzip,'2'=bzip2 |
In other words, the uncompressed signature is just the characters 'llvm' +while the compressed signature is the characters 'llvc' followed by an ascii +digit ('0', '1', or '2') that indicates the kind of compression used. A value of +'0' indicates that null compression was used. This can happen when compression +was requested on a platform that wasn't configured for gzip or bzip2. A value of +'1' means that the rest of the file is compressed using the gzip algorithm and +should be uncompressed before interpretation. A value of '2' means that the rest +of the file is compressed using the bzip2 algorithm and should be uncompressed +before interpretation. In all cases, the data resulting from uncompression +should be interpreted as if it occurred immediately after the 'llvm' +signature (i.e. the uncompressed data begins with the +Module Block
+NOTE: As of LLVM 1.4, all bytecode files produced by the LLVM tools +are compressed byte default. To disable compression, pass the +--disable-compression option to the tool, if it supports it.