This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Multiple sections with the same name again
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Thu, 20 May 2004 13:39:54 -0700
- Subject: Multiple sections with the same name again
While working on the merge section bug, I noticed that _bfd_merge_section
does
for (sinfo = (struct sec_merge_info *) *psinfo; sinfo; sinfo = sinfo->next)
if ((secinfo = sinfo->chain)
&& ! ((secinfo->sec->flags ^ sec->flags) & (SEC_MERGE | SEC_STRINGS))
&& secinfo->sec->entsize == sec->entsize && ! strcmp
(secinfo->sec->name, sec->name))
break;
It won't work right with multiple sections with the same name. There
may be more places like that. What is the best way to make sure we
catch and fix all of them? I am thinking to add a new bfd target
function, match_section_signature, and change "name" to "foobar"
temporarily. Replace all strcmp (sec1->name, sec2->name) with
bfd_match_section_signature (sec1, sec2) and change "foobar" back to
"name".
H.J.