Multiple sections with the same name again
H. J. Lu
hjl@lucon.org
Thu May 20 22:54:00 GMT 2004
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.
More information about the Binutils
mailing list