From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15985 invoked by alias); 18 Nov 2005 14:21:26 -0000 Received: (qmail 15976 invoked by uid 22791); 18 Nov 2005 14:21:24 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 18 Nov 2005 14:21:24 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jAIELLqV015029; Fri, 18 Nov 2005 15:21:21 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jAIELKSq030561; Fri, 18 Nov 2005 15:21:20 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jAIELKb5020229; Fri, 18 Nov 2005 15:21:20 +0100 (CET) Date: Fri, 18 Nov 2005 15:30:00 -0000 Message-Id: <200511181421.jAIELKb5020229@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: randolph@tausq.org CC: gdb-patches@sources.redhat.com In-reply-to: <437DD009.1080302@tausq.org> (message from Randolph Chung on Fri, 18 Nov 2005 20:58:49 +0800) Subject: Re: [hppa-hpux] Core file support for hppa64-hp-hpux11.11 References: <437C76DE.5020108@tausq.org> <200511171244.jAHCi9RY004505@elgar.sibelius.xs4all.nl> <437C7E07.5050804@tausq.org> <200511171446.jAHEkDim026595@elgar.sibelius.xs4all.nl> <437D15C4.9000207@tausq.org> <200511180008.jAI08jpp000219@elgar.sibelius.xs4all.nl> <437DD009.1080302@tausq.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00328.txt.bz2 > Date: Fri, 18 Nov 2005 20:58:49 +0800 > From: Randolph Chung > > > Yes. The section will come out as .core.kernel in objdump. Perhaps > > it should be .hp.core.kernel. I'll leave the naming decision to you > > and/or the binutils maintainers. But I think that's better than > > having all those .proc0, .proc1, .proc2 sections that we have now. > > And it makes it easier to pick the right one from GDB. > > actually there's no . prefix unless i explicitly pass one, and they will > look like: Hmm, looks like I misread the code in bfd//elf.c then. > /home/tausq/core: file format elf64-hppa > > Sections: > Idx Name Size VMA LMA File off > Algn > 0 hp.core.version0 00000004 0000000000000000 0000000000000000 > 00000350 2**0 > CONTENTS, READONLY > 1 hp.core.kernel1 0000003c 0000000000000000 0000000000000000 > 00000354 2**0 > CONTENTS, READONLY > 2 hp.core.comm2 00000009 0000000000000000 0000000000000000 > 00000390 2**0 > CONTENTS, READONLY > [...] > > Does this match what you have in mind? It sort of screws up the formatting doesn't it. Perhaps something like the attached is better; we only need the HP_CORE_KERNEL section don't we? This gives output like this: /tmp/core: file format elf64-hppa Sections: Idx Name Size VMA LMA File off Algn 0 proc0 00000004 0000000000000000 0000000000000000 00000350 2**0 CONTENTS, READONLY 1 proc1 0000003c 0000000000000000 0000000000000000 00000354 2**0 CONTENTS, READONLY 2 .kernel 0000003c 0000000000000000 0000000000000000 00000354 2**0 CONTENTS, READONLY 3 proc2 00000009 0000000000000000 0000000000000000 00000390 2**0 CONTENTS, READONLY 4 proc3 00000498 0000000000000000 0000000000000000 000003a0 2**0 CONTENTS, READONLY 5 .reg/0 00000498 0000000000000000 0000000000000000 000003a0 2**2 CONTENTS 6 .reg 00000498 0000000000000000 0000000000000000 000003a0 2**2 CONTENTS 7 proc4 0000c000 8000000100000000 0000000000000000 00000838 2**0 CONTENTS, ALLOC, LOAD, CODE Index: ChangeLog from Mark Kettenis * elf64-hppa.c (elf64_hppa_section_from_phdr): Create .kernel pseudo-section. Make sure .reg section comes after the proc section it's generated from. Index: elf64-hppa.c =================================================================== RCS file: /cvs/src/src/bfd/elf64-hppa.c,v retrieving revision 1.66 diff -u -p -r1.66 elf64-hppa.c --- elf64-hppa.c 18 Nov 2005 00:48:50 -0000 1.66 +++ elf64-hppa.c 18 Nov 2005 14:19:00 -0000 @@ -2652,6 +2652,22 @@ static bfd_boolean elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename) { + if (hdr->p_type == PT_HP_CORE_KERNEL) + { + asection *sect; + + if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename)) + return FALSE; + + sect = bfd_make_section_anyway (abfd, ".kernel"); + if (sect == NULL) + return FALSE; + sect->size = hdr->p_filesz; + sect->filepos = hdr->p_offset; + sect->flags = SEC_HAS_CONTENTS | SEC_READONLY; + return TRUE; + } + if (hdr->p_type == PT_HP_CORE_PROC) { int sig; @@ -2663,10 +2679,12 @@ elf64_hppa_section_from_phdr (bfd *abfd, elf_tdata (abfd)->core_signal = sig; - /* gdb uses the ".reg" section to read register contents. */ - if (!_bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz, - hdr->p_offset)) + if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename)) return FALSE; + + /* GDB uses the ".reg" section to read register contents. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz, + hdr->p_offset); } if (hdr->p_type == PT_HP_CORE_LOADABLE