[llvm-dev] ELF object writing from assembly file

Sky Flyer via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 15 04:38:28 PDT 2015

Thanks a lot Tim.

I am getting an error which says: "LLVM ERROR: unable to write nop sequence
of 0 bytes"
Is there any way that I can print out the Obj code (I mean bitstream
representation of the assembly code which is going to be placed in the ELF
file), before making any ELF file?


On Tue, Oct 13, 2015 at 3:02 PM, Tim Northover <t.p.northover at gmail.com>

> On 13 October 2015 at 02:19, Sky Flyer via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I tried this commands, but it didn't work corrctly:
> >
> > llvm-mc -filetype=obj -arch=test file.s -o=a.o
> That looks right to me ("-triple test-elf" might be more robust and
> work if you're coding on OS X or Windows).
> > and I think after an obj file is built, I should use this command but I
> am
> > not sure!
> >
> > llvm-objdump -arch=test a.o
> Either llvm-objdump or llvm-readobj will work. llvm-readobj tends to
> produce lower level information, while llvm-objdump is more
> user-friendly. They ought to mostly work on the generic information
> without changes.
> If you want "-d" (disassemble) to work, you're going to have to
> implement a Disassembler in your target too.
> Tim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151015/0b0863ae/attachment-0001.html>

More information about the llvm-dev mailing list