This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: INPUT_SECTION_FLAGS broken (Was: [RFA] PowerPC VLE port)
- From: Alan Modra <amodra at gmail dot com>
- To: James Lemke <jwlemke at codesourcery dot com>
- Cc: binutils at sourceware dot org, Catherine Moore <clm at codesourcery dot com>, "Maciej W. Rozycki" <macro at codesourcery dot com>, Rhonda Wittels <rhonda at CodeSourcery dot com>
- Date: Wed, 9 May 2012 13:23:50 +0930
- Subject: Re: INPUT_SECTION_FLAGS broken (Was: [RFA] PowerPC VLE port)
- References: <20110813114725.GH19463@bubble.grove.modra.org> <4F47BE0C.1000706@mentor.com> <20120301124020.GA3468@bubble.grove.modra.org> <4F8C3A3C.9020602@codesourcery.com> <4F8DAF72.2000901@codesourcery.com> <20120420065128.GT3218@bubble.grove.modra.org> <4F91C623.60505@codesourcery.com> <20120421044734.GW3218@bubble.grove.modra.org> <20120421064331.GZ3218@bubble.grove.modra.org> <4FA979F0.1050202@codesourcery.com>
On Tue, May 08, 2012 at 03:54:24PM -0400, James Lemke wrote:
> Alan,
> I have incorporated your suggestions regarding section flags.
> Updated patches are attached.
Thanks for your patience. This is OK to commit except
> * elf32-ppc.c (ppc_elf_modify_segment_map): New function.
> (elf_backend_modify_segment_map): Define.
> (has_tls_reloc, has_tls_get_addr_call): Moved out.
Please don't move these flags out of elf32-ppc.c into elf/ppc.h, or
put your new has_vle_insns flag in elf/ppc.h. They don't really
belong there. This too is a little sloppy:
> + /* Disassemble according to the section headers flags for VLE-mode. */
> + if (dialect & PPC_OPCODE_VLE
> + && info->section->has_vle_insns)
> + return dialect;
What if you're disassembling a ppc64 object file where sec_flg2 has a
different meaning? Fix this by passing info->section to a predicate
function living in elf32-ppc.c something along the lines of
bfd_boolean
is_ppc_vle (asection *sec)
{
return (sec->owner != NULL
&& is_ppc_elf (sec->owner)
&& sec->has_vle_insns);
}
Declare in, I dunno, elf32-ppc.h preferably but this will require
you to pull other headers into ppc-dis.h. elf-bfd.h as a last resort.
Also
-/* This bit is reserved by BFD for processor specific stuff. Name
- it properly so that we can easily stay consistent elsewhere. */
-#define SEC_PPC_VLE SEC_TIC54X_BLOCK
went quite a while ago, which you'll discover when you try to commit
the patch. Please fix corresponding changelog.
There are a few other things that need tidying but we can address them
once you've committed your patch.
--
Alan Modra
Australia Development Lab, IBM