From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by sourceware.org (Postfix) with ESMTPS id BB1FF3858D1E for ; Fri, 11 Feb 2022 14:17:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB1FF3858D1E Received: by mail-oo1-xc31.google.com with SMTP id u25-20020a4ad0d9000000b002e8d4370689so10434368oor.12 for ; Fri, 11 Feb 2022 06:17:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=OOsxv2+N3Ogh58AGXsePebhX9rkujSWS+7Fm9Hc9MSE=; b=QkWwbyWMouZGwg/IfSaq1PwjR5rkNv8ZaMcZ2cETcrwzviQzldg97biHZ2L7DPXXuM qjPHjd0d6CJgMY3pV+lHGwTtOFy8tD7S8P+EHi2Zi02ZsQ3Ol23TC1frWhLriBw+pFOV gnpndAqoGvv3etTjLf0tCEwWUWMVdKOmSTZmnwc2pZfC6h/9Hg+E7NxFRafwmQQ8NZVi 5vQ2i/OPE2I6u051VQYQSPnMg0GXN8uemDO6CTT11M3qXfLiT580v4okEyNnQHWQqml0 aIt9xrkUaj+qDt44NQexSWfU3TRXN/QyrQResfG6ikdrRNgns6YLl2OIV5jKQLwkLeW4 kvWA== X-Gm-Message-State: AOAM532AOkba1LUm3IcJ1moMfI3Zbf5hhIyxj/W0B9qSnxHSaRGJLNJC fP64TAWFXmBMJE6TRiYAOXGzeg== X-Google-Smtp-Source: ABdhPJzepFdOV8iCOUDaNlsetoEmkVBuyV1luYCvokUUp3yrmEL1FmVctBpVTzjzsJKtENGEtqycow== X-Received: by 2002:a05:6870:9511:: with SMTP id u17mr195444oal.160.1644589035095; Fri, 11 Feb 2022 06:17:15 -0800 (PST) Received: from ?IPV6:2804:431:c7ca:733:82fc:6b41:692a:b9e0? ([2804:431:c7ca:733:82fc:6b41:692a:b9e0]) by smtp.gmail.com with ESMTPSA id j3sm9584687oig.37.2022.02.11.06.17.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Feb 2022 06:17:14 -0800 (PST) Message-ID: <6cc1d2ae-f399-10d2-833b-4c17bd774892@linaro.org> Date: Fri, 11 Feb 2022 11:17:12 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2 5/5] Linux: Consolidate auxiliary vector parsing Content-Language: en-US To: Florian Weimer , Szabolcs Nagy Cc: libc-alpha@sourceware.org References: <151c5398adbbe538a275ea5ac77705b0abd0d748.1643886336.git.fweimer@redhat.com> <20220211123110.GB2692478@arm.com> <0dea5e89-25fb-3e17-8142-878482f171dd@linaro.org> <20220211132419.GC2692478@arm.com> <87a6exv7gd.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87a6exv7gd.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Feb 2022 14:17:17 -0000 On 11/02/2022 10:49, Florian Weimer wrote: > * Szabolcs Nagy: > >> The 02/11/2022 09:47, Adhemerval Zanella wrote: >>> On 11/02/2022 09:31, Szabolcs Nagy via Libc-alpha wrote: >>>> The 02/03/2022 12:08, Florian Weimer via Libc-alpha wrote >>>>> + dl_parse_auxv_t auxv_values = { 0, }; >>>>> + _dl_parse_auxv (av, auxv_values); >>>> >>>> this seems to use memset now on aarch64 before irelative >>>> relocs are resolved in static binaries. >>>> >>>> which causes infinite loops in the iplt (i've also seen >>>> segfaults in the build log). >>>> >>>> i wonder what is a clean fix... >>>> >>> >>> Maybe add inhibit_loop_to_libcall to avoid the memset call. >> >> does not work for me.. >> happens at -O0 too >> https://godbolt.org/z/W9r3nffYd > > Seems to happen with -fno-builtin or -ffreestanding as well. It's a GCC > bug, but I'll investigating working around it. I don't think it is gcc bug, even for -ffreestanding compiler can assume the C environment will always provide memset/memcpy. The problem is we need a gcc option to avoid such optimization, which afaik there is none. And without such option I think we will need to either revert this change or use the symbol alias strategy to avoid using IFUNC on loader code.