[llvm-dev] Using '__attribute__((section("name")))' for inline assembly injection

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 5 03:55:10 PDT 2016


On Wed, Oct 05, 2016 at 09:56:56AM +0100, Martin J. O'Riordan via llvm-dev wrote:
> I recently examined a bug in a program, and it turned out that the customer
> was using the section attribute as a form of inline-assembly mechanism, with
> something like:
> 
> __attribute__((section("sectionName\nasm\nasm\nasm")))

With clang, this does exactly what is requested. Note that GNU as will
give you a warning when using -save-temps or -S, but that's a separate
question.

Joerg


More information about the llvm-dev mailing list