lkml.org 
[lkml]   [2019]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/17] x86, lto: Mark all top level asm statements as .text
> +     asm(".pushsection .rodata, \"a\"\n"                             \                                                
> + NATIVE_LABEL("start_", ops, name) \
> + code \
> + NATIVE_LABEL("end_", ops, name) \
> + ".popsection\n")

>
> It's static so it's scope is within the file and whatever GCC does with
> that C function it has to respect that it accesses static data. If that's
> not true then this really needs to be fixed at the compiler side and not in
> the kernel.

Ok so you did the statics with undefined size, so kind of an extern static.
That's a weird construct (not sure if it's even allowed in standard C), but
somehow it seems to work in gcc with the inline assembler.

I checked the code general and with the .globl in NATIVE_LABEL the
generated assembler looks like it should work even for LTO yes.

I guess it's an interesting alternative to making them all global.
Maybe that will work for more cases too.

Thanks.

-Andi

\
 
 \ /
  Last update: 2019-03-27 21:41    [W:0.083 / U:1.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site