From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105471 invoked by alias); 16 Feb 2018 08:49:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 105453 invoked by uid 89); 16 Feb 2018 08:49:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-16.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Feb 2018 08:49:36 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AC77A402291E for ; Fri, 16 Feb 2018 08:49:32 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-204-85.brq.redhat.com [10.40.204.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D08E100F9D6 for ; Fri, 16 Feb 2018 08:49:31 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w1FBX4V2012480; Thu, 15 Feb 2018 12:33:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w1FBX1Wf012478; Thu, 15 Feb 2018 12:33:01 +0100 Date: Fri, 16 Feb 2018 08:49:00 -0000 From: Jakub Jelinek To: Szabolcs Nagy Cc: Ian Lance Taylor , Segher Boessenkool , David Edelsohn , Alan Modra , nd@arm.com, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Handle PowerPC64 ELFv1 function descriptors in libbacktrace (PR other/82368) Message-ID: <20180215113301.GK5867@tucnak> Reply-To: Jakub Jelinek References: <20180214114138.GX5867@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00956.txt.bz2 On Thu, Feb 15, 2018 at 11:08:20AM +0000, Szabolcs Nagy wrote: > > --- libbacktrace/elf.c.jj 2018-02-08 20:46:10.671242369 +0000 > > +++ libbacktrace/elf.c 2018-02-14 08:39:06.674088951 +0000 > ... > > @@ -2857,6 +2889,23 @@ elf_add (struct backtrace_state *state, > > debuglink_crc = *(const uint32_t*)(debuglink_data + crc_offset); > > } > > } > > + > > + /* Read the .opd section on PowerPC64 ELFv1. */ > > + if (ehdr.e_machine == EM_PPC64 > > + && (ehdr.e_flags & EF_PPC64_ABI) < 2 > > + && shdr->sh_type == SHT_PROGBITS > > this broke baremetal arm targets (e.g. aarch64-none-elf with newlib) > > ...src/gcc/libbacktrace/elf.c: In function 'elf_add': > ...src/gcc/libbacktrace/elf.c:2896:24: error: 'SHT_PROGBITS' undeclared (first use in this function) > > && shdr->sh_type == SHT_PROGBITS > ^~~~~~~~~~~~ Oops, sorry, fixed thusly, committed as obvious to trunk. 2018-02-15 Jakub Jelinek PR other/82368 * elf.c (SHT_PROGBITS): Undefine and define. --- libbacktrace/elf.c.jj 2018-02-14 15:19:13.849333101 +0100 +++ libbacktrace/elf.c 2018-02-15 12:30:53.948579969 +0100 @@ -170,6 +170,7 @@ dl_iterate_phdr (int (*callback) (struct #undef SHN_LORESERVE #undef SHN_XINDEX #undef SHN_UNDEF +#undef SHT_PROGBITS #undef SHT_SYMTAB #undef SHT_STRTAB #undef SHT_DYNSYM @@ -267,6 +268,7 @@ typedef struct { #define SHN_LORESERVE 0xFF00 /* Begin range of reserved indices */ #define SHN_XINDEX 0xFFFF /* Section index is held elsewhere */ +#define SHT_PROGBITS 1 #define SHT_SYMTAB 2 #define SHT_STRTAB 3 #define SHT_DYNSYM 11 Jakub