From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8390 invoked by alias); 21 Oct 2010 22:26:17 -0000 Received: (qmail 8378 invoked by uid 22791); 21 Oct 2010 22:26:16 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.17.164) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Oct 2010 22:26:10 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.1/8.13.1) with ESMTP id o9LMQ7dU024882 for ; Thu, 21 Oct 2010 22:26:07 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9LMQ7kh3997872 for ; Fri, 22 Oct 2010 00:26:07 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o9LMQ6v8013646 for ; Fri, 22 Oct 2010 00:26:06 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id o9LMQ5dj013628; Fri, 22 Oct 2010 00:26:05 +0200 Message-Id: <201010212226.o9LMQ5dj013628@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 22 Oct 2010 00:26:05 +0200 Subject: Re: [rfc/rfa] Use ARM exception tables as GDB unwinder To: dan@codesourcery.com (Daniel Jacobowitz) Date: Thu, 21 Oct 2010 22:26:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, rearnsha@arm.com, matthew.gretton-dann@arm.com In-Reply-To: <20101021160155.GP8337@caradoc.them.org> from "Daniel Jacobowitz" at Oct 21, 2010 12:01:56 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00344.txt.bz2 Dan Jacobowitz wrote: > No, this is not the case. The linker is supposed to fix it up: > > /* Scan .ARM.exidx tables, and create a list describing edits which should be > made to those tables, such that: > > 1. Regions without unwind data are marked with EXIDX_CANTUNWIND entries. > 2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind > codes which have been inlined into the index). > > If MERGE_EXIDX_ENTRIES is false, duplicate entries are not merged. > > The edits are applied when the tables are written > (in elf32_arm_write_section). > */ > > If it's not doing that, we should figure out why - it can lead to > crashes in libgcc, if the unwinder is invoked, rather than the correct > failure to unwind. > > I think 2.19 didn't do this but 2.20 did. Well, the function elf32_arm_fix_exidx_coverage you refer to above is never called for a relocatable link ... Unfortunately, the glibc link process works like this (abbreviated): - build all the objects (some with exidx, some without) - collect objects into an archive libc_pic.a - do a relocatable link: -o libc_pic.os -r --whole-archive libc_pic.a - build shared object: -o libc.so -shared ... libc_pic.os ... The relocatable link step concatenates the text sections of objects with exidx and those without, but does not call any special fixup routine, so no EXIDX_CANTUNWIND entries are inserted. The shared object final link step *does* run the fixup routine, but since it now only sees a single big text section, it doesn't fix up anything ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com