This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Incorrect use of SEC_MERGE in tc-ppc.c
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: ezannoni at redhat dot com, binutils at sources dot redhat dot com
- Date: Wed, 27 Nov 2002 12:32:21 -0500
- Subject: Re: Incorrect use of SEC_MERGE in tc-ppc.c
- References: <20021127175321.K1310@sunsite.ms.mff.cuni.cz>
Jakub Jelinek writes:
> Hi!
>
> tc-ppc.c (ppc_cleanup) does:
>
> /* Create the .PPC.EMB.apuinfo section. */
> apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0);
> bfd_set_section_flags (stdoutput,
> apuinfo_secp,
> SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
>
> yet never sets apuinfo_secp->entsize.
> This is wrong, every SHF_MERGE section must have non-zero sh_entsize,
> either it is the size of each constant, or if SHF_STRINGS is set too
> it is size of character in the strings.
> As .PPC.EMB.apuinfo is not fixed size section, there is no suitable
> entsize value though.
> If you want to merge .PPC.EMB.apuinfo sections from a.o and b.o iff
> they are the same size and have same content, then more work is needed,
> like instead of creating .PPC.EMB.apuinfo section create
> e.g. .PPC.EMB.apuinfo.<ppc_apuinfo_num> section with SEC_MERGE
> and apuinfo_secp->entsize = 20 + ppc_apuinfo_num * 4.
> Then also linker script needs to be tweaked, so that it has
> .PPC.EMB.apuinfo : { *(.PPC.EMB.apuinfo .PPC.EMB.apuinfo.*) }
> for non-relocatable build.
> If some other merging is wanted instead, please explain what exactly.
>
> Jakub
Sorry, I only committed the code. I'll see if I can do something about
it. The original author is, ahem..., 'unavailable for comments'.
Elena