lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Nov 2019 10:45:58 +0100
From:   Jessica Yu <jeyu@...nel.org>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Matthias Maennich <maennich@...gle.com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Will Deacon <will@...nel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        "binutils@...rceware.org" <binutils@...rceware.org>
Subject: Re: [PATCH] export.h: reduce __ksymtab_strings string duplication by
 using "MS" section flags

+++ Rasmus Villemoes [25/11/19 10:29 +0100]:
>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@...nel.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;
>+                   }

Yeah, I saw this too while digging. I also came across this commit in
the binutils source:

commit ecc054c097e7ced281d02ef9632eb0261a410b96
Author: Thomas Preud'homme <thomas.preudhomme@....com>
Date:   Fri Mar 2 11:51:34 2018 +0000

    [GDB/testsuite] Use %progbits in watch-loc.c

    While using @progbits in .pushsection work on some targets, it does not
    work on arm target where this introduces a comment. This patch replaces
    its use in gdb.dlang/watch-loc.c and gdb.mi/dw2-ref-missing-frame-func.c
    by %progbits which should work on all targets since it is used in
    target-independent elf/section7.s GAS test.

    2018-03-02  Thomas Preud'homme  <thomas.preudhomme@....com>

    gdb/testsuite/
            * gdb.dlang/watch-loc.c: Use %progbits instead of @progbits.
            * gdb.mi/dw2-ref-missing-frame-func.c: Likewise.

So that seems to confirm this theory :-) I'm just surprised it isn't
documented anywhere it seems.

>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:
>
>'@...gbits'
>     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.

Yup, sounds good. Thanks!

Jessica

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ