<div dir="ltr">Hi,<div><br></div><div>Can STRTAB_BLOCK include more than one STRTAB_BLOB records?</div><div><br></div><div><a href="https://llvm.org/docs/BitCodeFormat.html#strtab-block-contents">https://llvm.org/docs/BitCodeFormat.html#strtab-block-contents</a> says</div><div><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><font size="1">"""</font><font size="1">The </font><code class="gmail-docutils gmail-literal gmail-notranslate" style="font-size:x-small;font-family:Consolas,"Deja Vu Sans Mono","Bitstream Vera Sans Mono",monospace"><span class="gmail-pre" style="hyphens: none;">STRTAB</span></code><font size="1"> block (id 23) contains a </font><b>single</b><font size="1"> record (</font><code class="gmail-docutils gmail-literal gmail-notranslate" style="font-size:x-small;font-family:Consolas,"Deja Vu Sans Mono","Bitstream Vera Sans Mono",monospace"><span class="gmail-pre" style="hyphens: none;">STRTAB_BLOB</span></code><font size="1">, id 1) with a single blob operand containing the bitcode file’s string table. ...</font><span style="font-size:x-small">"""</span></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif">The code <a href="https://llvm.org/doxygen/BitcodeReader_8cpp_source.html#l06407">readBlobInRecord</a> also assumes this because if there are multiple blob records, only the last one returns.<br></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><br></p><p style="margin:0.8em 0px 0.5em"><span style="color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif">I found an "Invalid encoding" from <a href="https://llvm.org/doxygen/BitCodes_8h_source.html#l00126" style="font-family:Arial,Helvetica,sans-serif">hasEncodingData</a> when reading the bitcode generated by LTO. This happens when reading </span>a STRTAB_BLOCK. The STRTAB_BLOCK contains the following:<br></p><p style="margin:0.8em 0px 0.5em"><br></p><p style="margin:0.8em 0px 0.5em"><i><code class="gmail-docutils gmail-literal gmail-notranslate" style="font-family:Consolas,"Deja Vu Sans Mono","Bitstream Vera Sans Mono",monospace"><span class="gmail-pre" style="hyphens: none;">STRTAB</span></code> block<br></i></p><p style="margin:0.8em 0px 0.5em"><i>    abbrev definition, 1, blob       // abbrev_id = 4</i></p><p style="margin:0.8em 0px 0.5em"><i>    STRTAB_BLOB, 549524261, data</i></p><p style="margin:0.8em 0px 0.5em"></p><p style="margin:0.8em 0px 0.5em"></p><p></p><p style="margin:0.8em 0px 0.5em"><i>    STRTAB_BLOB, 29258, data</i></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><i>   abbrev definition, 14, ..... // crashes when reading the 9th operand where the encoding data are not <a href="https://llvm.org/doxygen/BitCodes_8h_source.html#l00100">between 1 to 5</a>.</i></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><br></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif">Does this mean the bitcode generated by LTO was corrupt? Does anyone happen to have a similar issue before?</p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><br></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif">Thank you, S</p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><br></p><p style="margin:0.8em 0px 0.5em;color:rgb(0,0,0);font-family:"Lucida Grande","Lucida Sans Unicode",Geneva,Verdana,sans-serif"><br></p></div></div>