Clang inline assembly issue

Hi guys,

I have a issue caused by some inline assembly. Basically when there is file scope inline assembly the clang front end will not include it in any section if the section is not specified by the inline asm itself. Furthermore this issue seems to only occur when generating LLVM bitcode. That is for the following code snippet

__asm__(".globl func\n\t.align 4\nfunc: ret"); int main() { return 0 ;}

We have the following cases:
$ clang file.c -o binary # compiles without errors

$ echo $?

$ clang -c -flto file.c -o file.o

$ -plugin /opt/llvm/lib/ file.o -o binary
error: expected section directive before assembly directive
.align 4

I wasn’t able to find any paper or thorough documentation on how the compilation is handled by clang in these two cases. Shouldn’t it behave identical?