[llvm-dev] LLVM does not recognize .dword directive.

Alex Bradbury via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 16 06:55:47 PDT 2018


On 16 August 2018 at 14:24, sumedh jambekar via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hello All,
>
> I am trying to compile the assembly language file using clang compiler. The
> assembly language file has many directives, and ".dword" is one of the
> directives among those.
>
> When I try to compile, I am hitting the following error:
> unknown directive .dword
>
> If any one of you have seen this error before and solved it, can you please
> help me in solving this?

What architecture are you targeting? If gas for your architecture
accepts .dword but LLVM's assembler doesn't then it is worth filing a
bug <https://bugs.llvm.org/>.

dword isn't one of the directives that is supported by the default
AsmParser logic. The best way to enable it for a specific targetis to
edit lib/Target/FooTarget/AsmParser/FooTargetAsmParser.cpp and add
`Parser.addAliasForDirective(".dword", ".8byte");` or simlar to the
FooTargetAsmParser constructor.

Best,

Alex


More information about the llvm-dev mailing list