From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 302A63858C1F for ; Mon, 14 Aug 2023 13:12:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 302A63858C1F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692018756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qz7hts/dor99/IeU4YKmcuTxfQkNMvQkYci+CmlzF/w=; b=VeT1lkLZBt8wcctdy9EVxNEVSqe7+66e9WvXvd28i//n3mYGu75rchXo9deB1Jj82EjsBT 8Fa5S2gusLmu7l1iUG1FEvEe07Gz6umEQVASlhadoCbJ+bVghy8gO3TCeZ53oYy6YfcKCA m65eAvvph81UOzUvQjzKX8JQBtGskG8= Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-n0RQzo5YPWiAFjy4LDKwJA-1; Mon, 14 Aug 2023 09:12:35 -0400 X-MC-Unique: n0RQzo5YPWiAFjy4LDKwJA-1 Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-589f437fef0so14288087b3.3 for ; Mon, 14 Aug 2023 06:12:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692018754; x=1692623554; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qz7hts/dor99/IeU4YKmcuTxfQkNMvQkYci+CmlzF/w=; b=bIY7NaQRVROchidxx3Ewc7msgkFx3Ow3U5k9MAwq1+myMXOmL9YoTDf/HIuNi8Y8JA DVENigg/MN5O+xiqUNsNZK10kPbSMh5wu6K2Ou7vc437uOJqC3a+iNGuYloHYUB/W7TD e92rb7xW4VDDkduWUiMWnUQ4zBYMNjGXPiL8Qtc0zT2kkehKXMpyTJp1hxRMFjKvJioJ Hi3jNziBR+hCliF9WtO8Iq0+uFzeNkm0Ovp0aOyaQlt8OryqeiouSeGIbK1KZ9u5CCT6 6DzqLvQgtvhqQVKU5uQBIuYNDj0dJ5gXc9lM/pfhQ22KAjqqCPC1iAJ6FIuly1GB4gz9 fx5w== X-Gm-Message-State: AOJu0YyJM6Pl230ryNe4U+EBIVwR+iNwBhipD3B7cqxVBWmw5xLKUJl7 IZrvf52aQhDVra8xEI1HxGmv4eZ9NNHmPvci0cGaUpmCxGSHeZE36JCZhxKGorYx84UqZONMQCb kjCLPyUckCDh51xfPlyVUHRM7E+jH X-Received: by 2002:a81:6286:0:b0:576:a603:e733 with SMTP id w128-20020a816286000000b00576a603e733mr12493201ywb.22.1692018754242; Mon, 14 Aug 2023 06:12:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVy9G0RtRfVToKK+TdZanPMZ3YFlHkRfi+Yf4yzRx8cAGeErsY8I+ugJzG3iIIxjwNv2Bmsw== X-Received: by 2002:a81:6286:0:b0:576:a603:e733 with SMTP id w128-20020a816286000000b00576a603e733mr12493180ywb.22.1692018753806; Mon, 14 Aug 2023 06:12:33 -0700 (PDT) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id o206-20020a8173d7000000b00586108dd8f5sm2755488ywc.18.2023.08.14.06.12.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Aug 2023 06:12:33 -0700 (PDT) Message-ID: <38355557-5f5e-8149-0b01-8444419c7b0e@redhat.com> Date: Mon, 14 Aug 2023 09:12:31 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] RISC-V: Enable static-pie. To: yanzhang.wang@intel.com, libc-alpha@sourceware.org References: <20230810233348.1214955-1-yanzhang.wang@intel.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20230810233348.1214955-1-yanzhang.wang@intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/10/23 19:33, yanzhang.wang--- via Libc-alpha wrote: > From: Yanzhang Wang > > This patch referents the commit 374cef3 to add static-pie support. And > because the dummy link map is used when relocating ourselves, so need > not to set __global_pointer$ at this time. This fails pre-commit CI. https://patchwork.sourceware.org/project/glibc/patch/20230810233348.1214955-1-yanzhang.wang@intel.com/ Patch conflict in configure. Please make sure you are regenerating properly. > --- > sysdeps/riscv/configure | 2 ++ > sysdeps/riscv/configure.ac | 3 +++ > sysdeps/riscv/dl-machine.h | 2 +- > 3 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/sysdeps/riscv/configure b/sysdeps/riscv/configure > index 2372225a26..340163779f 100644 > --- a/sysdeps/riscv/configure > +++ b/sysdeps/riscv/configure > @@ -29,3 +29,5 @@ fi > $as_echo "$libc_cv_riscv_r_align" >&6; } > config_vars="$config_vars > riscv-r-align = $libc_cv_riscv_r_align" > + > +$as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h > diff --git a/sysdeps/riscv/configure.ac b/sysdeps/riscv/configure.ac > index dbcc216689..36da2b5396 100644 > --- a/sysdeps/riscv/configure.ac > +++ b/sysdeps/riscv/configure.ac > @@ -16,3 +16,6 @@ EOF > fi > rm -rf conftest.*]) > LIBC_CONFIG_VAR([riscv-r-align], [$libc_cv_riscv_r_align]) > + > +dnl Static PIE is supported. > +AC_DEFINE(SUPPORT_STATIC_PIE) > diff --git a/sysdeps/riscv/dl-machine.h b/sysdeps/riscv/dl-machine.h > index c0c9bd93ad..ad875c0828 100644 > --- a/sysdeps/riscv/dl-machine.h > +++ b/sysdeps/riscv/dl-machine.h > @@ -323,7 +323,7 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[], > gotplt[1] = (ElfW(Addr)) l; > } > > - if (l->l_type == lt_executable) > + if (l->l_type == lt_executable && l->l_scope != NULL) > { > /* The __global_pointer$ may not be defined by the linker if the > $gp register does not be used to access the global variable -- Cheers, Carlos.