[llvm-commits] ARM ELF disassembly with integrated-as

Greg Fitzgerald garious at gmail.com
Tue Nov 27 19:00:21 PST 2012


Hi Tim and Jan,

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

A few things I've tried:

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.
2) Pass 'llc' two .ll files - one with an arm target, and one thumb.
 Error, llc only accepts one file at a time.
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?

If you want to try for yourself, here's an llvm spork with the patches:

$ git clone -b patch/arm-elf-mapping-symbols
https://github.com/garious/llvm.git llvm-garious
<build>
<???>
$ readelf -s data-in-code-mixed.o
<look for $a $t and $d mapping symbols>


How do I generate an object file with ARM and Thumb functions that have
data-in-code?

Thanks,
Greg



On Tue, Nov 13, 2012 at 11:38 AM, Tim Northover <t.p.northover at gmail.com>wrote:

> Hi Greg,
>
> > But since you have provided clear
> > direction on implementation, I'd be happy to give it a shot.
>
> Cheers.
>
> > There is no test for checking for duplicates.  I don't know how to do
> that
> > with FileCheck.  Is there a way or would I need another tool?
>
> I think CHECK-NOT is probably your friend. If you know a module should
> produce (say) only one $a then test-lines like:
>
> CHECK: $a
> CHECK-NOT: $a
>
> should make sure there aren't any extra. Even if a valid
> implementation could change that number, it'll at least make the next
> person who comes along to modify this code think about the issue.
>
> > > Wouldn't you need two functions to force the Streamer to
> > > ChangeSection to .text twice?
>
> > I don't understand.  Can you clarify?
>
> This was just my guess at the kind of code that made you decide to put
> that deduplication code in.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121127/93760289/attachment.html>


More information about the llvm-commits mailing list