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]

Relaxing a h8300 target debugginginformation.



When relaxing a h8300 target the code is relaxed but the debugging
information
is not. The following is my attempt to fix the problem BUT it does
not
work. Is the idea right but implemented wrong or what?

bfd/reloc16.c

void
bfd_perform_slip (abfd, slip, input_section, value)
     bfd *abfd;
     unsigned int slip;
     asection *input_section;
     bfd_vma value;
{
  asymbol **s;

  s = _bfd_generic_link_get_symbols (abfd);
  BFD_ASSERT (s != (asymbol **) NULL);

  /* Find all symbols past this point, and make them know
     what's happened.  */
  while (*s)
    {
      asymbol *p = *s;
      if (p->section == input_section)
        {
         /* This was pointing into this section, so mangle it. */
          if (p->value > value)
            {
+             alent *line;
+
+             p->value -= slip;
+             line = coff_get_lineno(abfd, p);
+             if (line) line->u.offset -= slip;
+
              if (p->udata.p != NULL)
                {
                  struct generic_link_hash_entry *h;

                  h = (struct generic_link_hash_entry *)p->udata.p;
                  BFD_ASSERT (h->root.type == bfd_link_hash_defined
                              || h->root.type == bfd_link_hash_defweak);

                  h->root.u.def.value -= slip;
                  BFD_ASSERT (h->root.u.def.value == p->value);
                }
            }
        }
      s++;
    }
}


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