From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by sourceware.org (Postfix) with ESMTPS id 82F7B3857C49 for ; Wed, 27 Apr 2022 18:54:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 82F7B3857C49 Received: by mail-oo1-xc32.google.com with SMTP id m22-20020a056820051600b0033a41079257so515010ooj.4 for ; Wed, 27 Apr 2022 11:54:31 -0700 (PDT) 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:references:from:in-reply-to :content-transfer-encoding; bh=QlnTPNtzkIF371l1ksy3EUWu/DEIusrm26Ozdvk3ZUM=; b=GhzODkYf6YHCxY+LifXL8PcWAt6wcy73ECf4YgZXLDlTf4BUNVU3aydH78Vq03g5+I Ir5SoWuQsXSQ4FRotNPEc7w5VkqaTCZDnTrrpe6e52R2CCecBZCwqEYhovDNJGpWO6BM u2ARDojqxOkU3hZIfA3QbuU5saDHM1hjOAVs89Nu59CP7aP6WMzEjCYgt4ARiksyC+iD Q5t2Yz/Esnt9ixo5ZR2I7sFWRC9wedw5YfA/5OOje56zyVVp3mD9hqJop6Ex+YnrUiVw khHNAsSXMAMjl/SfOwv/RQBCZCgdTT5LOXjCekjAjtKB0VELDf7WV0fxsb5C3ZUDvsJu 2xcg== X-Gm-Message-State: AOAM533GLW+glsrb/XTdDNuZFR96eh8GJGJ40ygPIjr3v0X7miETWO8a fovAR/jl7qax277DUXbf99y/+/FqM8p76Q== X-Google-Smtp-Source: ABdhPJxDJWONr74JtA9/4ERmk0EnbtP+k6bFo9fJ7Kc1ityrDqLBeLLSWRpO2tDtpfzwcq6WyT6bKA== X-Received: by 2002:a4a:bb0b:0:b0:338:e8bb:d5fc with SMTP id f11-20020a4abb0b000000b00338e8bbd5fcmr10634463oop.16.1651085670785; Wed, 27 Apr 2022 11:54:30 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:4214:b613:182d:cdde:5f86? ([2804:431:c7ca:4214:b613:182d:cdde:5f86]) by smtp.gmail.com with ESMTPSA id p17-20020a544611000000b00325001eeb80sm5093290oip.27.2022.04.27.11.54.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Apr 2022 11:54:30 -0700 (PDT) Message-ID: Date: Wed, 27 Apr 2022 15:54:27 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Use __ehdr_start rather than _begin in _dl_start_final Content-Language: en-US To: Alan Modra , libc-alpha@sourceware.org References: From: Adhemerval Zanella In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 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 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: Wed, 27 Apr 2022 18:54:33 -0000 On 27/04/2022 09:35, Alan Modra via Libc-alpha wrote: > __ehdr_start is already used in rltld.c:dl_main, and can serve the > same purpose as _begin. Besides tidying the code, using linker > defined section relative symbols rather than "-defsym _begin=0" better > reflects the intent of _dl_start_final use of _begin, which is to > refer to the load address of ld.so rather than absolute address zero. > > The motive for this patch is to finally tidy ppc32 GNU ld treatment of > absolute symbols. On ppc32, the reference to _begin generates a GOT > entry. A GOT entry for an absolute symbol shouldn't be dynamically > relocated, so this usage in glibc of an absolute _begin will fail once > I fix ppc32 ld. Note that on many other targets, including ppc64, gcc > generates pc relative or got-pointer relative addressing for _begin. > ie. the compiler assumes _begin is *not* at an absolute address, and > generally linkers go along with that. Does it mean that once you fix it, newer binutils will start to fail to build older glibc releases for powerpc32?