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]

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.


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