This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] export.h: reduce __ksymtab_strings string duplication by using "MS" section flags
- From: Rasmus Villemoes <linux at rasmusvillemoes dot dk>
- To: Masahiro Yamada <yamada dot masahiro at socionext dot com>, Jessica Yu <jeyu at kernel dot org>
- Cc: Linux Kernel Mailing List <linux-kernel at vger dot kernel dot org>, Matthias Maennich <maennich at google dot com>, Arnd Bergmann <arnd at arndb dot de>, Greg Kroah-Hartman <gregkh at linuxfoundation dot org>, Will Deacon <will at kernel dot org>, Catalin Marinas <catalin dot marinas at arm dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 25 Nov 2019 10:29:30 +0100
- Subject: Re: [PATCH] export.h: reduce __ksymtab_strings string duplication by using "MS" section flags
- References: <20191120145110.8397-1-jeyu@kernel.org> <93d3936d-0bc4-9639-7544-42a324f01ac1@rasmusvillemoes.dk> <20191121160919.GB22213@linux-8ccs> <CAK7LNAT=+VMTpK3nBy3J-M9idf8MBi4dB4WKexYatiV2pNHvMg@mail.gmail.com>
cc += binutils ML
[on @progbits v %progbits in generic (data only) assembly code]
On 22/11/2019 12.44, Masahiro Yamada wrote:
> On Fri, Nov 22, 2019 at 1:09 AM Jessica Yu <jeyu@kernel.org> wrote:
>>
>> I think this would work, and it feels like the more correct solution
>> especially if arm isn't the only one with the odd progbits char. It
>> might be overkill if it's just arm that's affected though. I leave it
>> to Masahiro to see what he prefers.
>>
>
>
> BTW, is there any reason why
> not use %progbits all the time?
>
>
> include/linux/init.h hard-codes %progbits
>
> #define __INITDATA .section ".init.data","aw",%progbits
> #define __INITRODATA .section ".init.rodata","a",%progbits
>
>
> So, my understanding is '%' works for all architectures,
> but it is better to ask 0-day bot to test it.
It seems that you're absolutely right. The binutils source has code like
+ if (*input_line_pointer == '@' || *input_line_pointer == '%')
+ {
+ ++input_line_pointer;
+ if (strncmp (input_line_pointer, "progbits",
+ sizeof "progbits" - 1) == 0)
+ {
+ type = SHT_PROGBITS;
+ input_line_pointer += sizeof "progbits" - 1;
+ }
+ else if (strncmp (input_line_pointer, "nobits",
+ sizeof "nobits" - 1) == 0)
+ {
+ type = SHT_NOBITS;
+ input_line_pointer += sizeof "nobits" - 1;
+ }
all the way back from
commit 252b5132c753830d5fd56823373aed85f2a0db63 (tag: binu_ss_19990502)
Author: Richard Henderson <rth@redhat.com>
Date: Mon May 3 07:29:11 1999 +0000
19990502 sourceware import
So yes, let's just try unconditionally using %progbits, that makes
everything much simpler.
The only reason I thought one needed to do it differently on ARM is this
from the gas docs:
===
The optional TYPE argument may contain one of the following
constants:
'@progbits'
section contains data
...
Note on targets where the '@' character is the start of a comment (eg
ARM) then another character is used instead. For example the ARM port
uses the '%' character.
===
That doesn't suggest the possibility that % or some other character
might work on all architectures.
Jessica, can you resend using just %progbits to let kbuild chew on that?
Please include a comment about the misleading gas documentation.
Rasmus