From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 315BD3857438 for ; Fri, 30 Apr 2021 12:51:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 315BD3857438 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D7E1D1063; Fri, 30 Apr 2021 05:50:59 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6241C3F73B; Fri, 30 Apr 2021 05:50:59 -0700 (PDT) From: Richard Sandiford To: Wilco Dijkstra via Gcc-patches Mail-Followup-To: Wilco Dijkstra via Gcc-patches , Wilco Dijkstra , richard.sandiford@arm.com Cc: Wilco Dijkstra Subject: Re: [PATCH] AArch64: Cleanup aarch64_classify_symbol References: Date: Fri, 30 Apr 2021 13:50:58 +0100 In-Reply-To: (Wilco Dijkstra via Gcc-patches's message of "Fri, 30 Apr 2021 12:11:36 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 12:51:01 -0000 Wilco Dijkstra via Gcc-patches writes: > Hi Richard, >> Hmm, OK.=C2=A0 I guess it makes things more consistent in that sense >> (PIC vs. non-PIC).=C2=A0 But on the other side it's making things less >> internally consistent for non-PIC, since we don't use the GOT for >> anything else there.=C2=A0 I guess in principle there's a danger that a >> custom *-elf linker script might not bother to set up the .got properly, >> on the assumption that it shouldn't be needed. > > The GOT is always used in executables (even an empty main function has > a non-zero .got and .got.plt section). The comment above was talking about *-elf scripts though. When I try the following locally, no .got is used: $ echo 'int main() { return 0; }' > foo.c $ aarch64-none-elf-gcc foo.c -mcmodel=3Dsmall --specs=3Daem-validation.specs $ aarch64-none-elf-readelf --sections ./a.out Thanks, Richard