Changeset 662c504 in rtems-tools


Ignore:
Timestamp:
Nov 29, 2012, 8:02:28 AM (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
9c70d15
Parents:
ea6f8d4
Message:

Add the index to the section.

The index is referenced in the symbol and relocation records of ELF files
therefore we need to search for them.

Location:
linkers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • linkers/rld-files.cpp

    rea6f8d4 r662c504  
    903903    section::section (const elf::section& es)
    904904      : name (es.name ()),
     905        index (es.index ()),
    905906        type (es.type ()),
    906907        size (es.size ()),
     
    929930
    930931      return size;
     932    }
     933
     934    const section*
     935    find (const sections& secs, const int index)
     936    {
     937      for (sections::const_iterator si = secs.begin ();
     938           si != secs.end ();
     939           ++si)
     940      {
     941        const section& sec = *si;
     942
     943        if (index == sec.index)
     944          return &sec;
     945      }
     946
     947      return 0;
    931948    }
    932949
  • linkers/rld-files.h

    rea6f8d4 r662c504  
    519519    {
    520520      const std::string name;      //< The name of the section.
     521      const int         index;     //< The section's index in the object file.
    521522      const uint32_t    type;      //< The type of section.
    522523      const size_t      size;      //< The size of the section.
     
    551552
    552553    /**
     554     * Find the section that matches the index in the sections provided.
     555     */
     556    const section* find (const sections& secs, const int index);
     557
     558    /**
    553559     * The object file cab be in an archive or a file.
    554560     */
Note: See TracChangeset for help on using the changeset viewer.