From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3609 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [PATCH 2/3] Unwind support for ARM EABI Date: Wed, 10 Jul 2013 14:05:07 -0400 Message-ID: <20130710180506.GB29800@brightrain.aerifal.cx> References: <1373463541-17170-1-git-send-email-timo.teras@iki.fi> <1373463541-17170-2-git-send-email-timo.teras@iki.fi> <20130710203518.576804e3@vostro> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1373479521 10668 80.91.229.3 (10 Jul 2013 18:05:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 10 Jul 2013 18:05:21 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3613-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 10 20:05:22 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1UwylV-0006EU-5r for gllmg-musl@plane.gmane.org; Wed, 10 Jul 2013 20:05:21 +0200 Original-Received: (qmail 5598 invoked by uid 550); 10 Jul 2013 18:05:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5587 invoked from network); 10 Jul 2013 18:05:20 -0000 Content-Disposition: inline In-Reply-To: <20130710203518.576804e3@vostro> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3609 Archived-At: On Wed, Jul 10, 2013 at 08:35:18PM +0300, Timo Teras wrote: > > diff --git a/arch/arm/src/find_exidx.c b/arch/arm/src/find_exidx.c > > new file mode 100644 > > index 0000000..ffbea1f > > --- /dev/null > > +++ b/arch/arm/src/find_exidx.c > > @@ -0,0 +1,44 @@ > > +#define _GNU_SOURCE > > +#include > > + > > +typedef unsigned _Unwind_Ptr; > > As noted on #musl, this has __attribute__((pointer)) in the original > definition. But trying to avoid the #include on GCC's > headers, and the GCCisms. > > Would uintptr_t be more suitable here then? Yes. unsigned "works" but only because this code is ARM-specific and ARM is 32-bit. > > +struct find_exidx_data { > > + _Unwind_Ptr pc, exidx_start; > > + int exidx_len; > > +}; > > + > > +static int find_exidx(struct dl_phdr_info *info, size_t size, void > > *ptr) +{ > > + struct find_exidx_data *data = ptr; > > + const ElfW(Phdr) *phdr = info->dlpi_phdr; > > + _Unwind_Ptr addr; > > + int match = 0, i; > > + > > + for (i = info->dlpi_phnum; i > 0; i--, phdr++) { > > + addr = info->dlpi_addr + phdr->p_vaddr; > > + switch (phdr->p_type) { > > + case PT_LOAD: > > + match |= data->pc >= addr && data->pc < addr > > + phdr->p_memsz; > > + break; > > + case PT_ARM_EXIDX: > > + data->exidx_start = addr; > > + data->exidx_len = phdr->p_memsz; > > + break; > > + } > > + } > > + return match; > > +} > > The above function has a slight bug in it, so I'll fix that for next > send. Basically it can return other dso's exidx data if the matching > dso did not have PT_ARM_EXIDX at all. OK, I'll wait for your next version of this patch. Rich