Hi Tim and Jan,<br><br>I could use some help creating a test case for adding mixed-mode support.  Adding EmitAssemblerFlag() as Tim suggested was <a href="https://github.com/garious/llvm/commit/a7133ad453c284c191fd7305ed29caf29e6f1d92" target="_blank">no problem</a>, but creating a test case that gets llc or llvm-mc to generate a file with both Thumb and ARM data sections is.<br>




<br>A few things I've tried:<div><br></div><div>1) The 'data-in-code.ll' file with 2 'target' instructions and compile with 'llc'.  No luck and no error.  The last 'target' is used for all functions in the module.</div>




<div>2) Pass 'llc' two .ll files - one with an arm target, and one thumb.  Error, llc only accepts one file at a time.</div><div>3) Create a .s file with both an ARM function and a Thumb function (and no .eabi_attribute directives) and compile with 'llvm-mc'.   A little luck here, so long as ".code" directives are present, but from what I can tell, the ARM parser doesn't implement data-in-code?</div>




<div><br></div><div>If you want to try for yourself, here's an llvm spork with the patches:</div><div><br>$ git clone -b patch/arm-elf-mapping-symbols <a href="https://github.com/garious/llvm.git" target="_blank">https://github.com/garious/llvm.git</a> llvm-garious</div>

<div><build></div><div><???></div><div>$ readelf -s data-in-code-mixed.o</div><div><look for $a $t and $d mapping symbols></div>


<div><br></div><div><br></div><div>How do I generate an object file with ARM and Thumb functions that have data-in-code?<br></div><div><br>Thanks,</div><div>Greg<br><br></div>


<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 13, 2012 at 11:38 AM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Greg,<br>
<div class="im"><br>
> But since you have provided clear<br>
> direction on implementation, I'd be happy to give it a shot.<br>
<br>
</div>Cheers.<br>
<div class="im"><br>
> There is no test for checking for duplicates.  I don't know how to do that<br>
> with FileCheck.  Is there a way or would I need another tool?<br>
<br>
</div>I think CHECK-NOT is probably your friend. If you know a module should<br>
produce (say) only one $a then test-lines like:<br>
<br>
CHECK: $a<br>
CHECK-NOT: $a<br>
<br>
should make sure there aren't any extra. Even if a valid<br>
implementation could change that number, it'll at least make the next<br>
person who comes along to modify this code think about the issue.<br>
<div class="im"><br>
> > Wouldn't you need two functions to force the Streamer to<br>
> > ChangeSection to .text twice?<br>
<br>
> I don't understand.  Can you clarify?<br>
<br>
</div>This was just my guess at the kind of code that made you decide to put<br>
that deduplication code in.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br></div>