This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Incorrect use of SEC_MERGE in tc-ppc.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]