Changeset 1976825 in rtems-tools


Ignore:
Timestamp:
Nov 18, 2012, 11:36:34 PM (7 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 4.11, master
Children:
596e5fa
Parents:
ead8da1
Message:

Resolve the ld and user undefines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • linkers/rld-resolver.cpp

    read8da1 r1976825  
    4040  {
    4141    static void
    42     resolve (rld::files::object_list& dependents,
    43              rld::files::cache&       cache,
    44              rld::symbols::table&     base_symbols,
    45              rld::symbols::table&     symbols,
    46              rld::files::object&      object)
     42    resolve_symbols (rld::files::object_list& dependents,
     43                     rld::files::cache&       cache,
     44                     rld::symbols::table&     base_symbols,
     45                     rld::symbols::table&     symbols,
     46                     rld::symbols::table&     unresolved,
     47                     const std::string&       name)
    4748    {
    4849      static int nesting = 0;
     
    5960       */
    6061
    61       rld::symbols::table& unresolved = object.unresolved_symbols ();
    62 
    6362      if (rld::verbose () >= RLD_VERBOSE_INFO)
    6463        std::cout << "resolver:resolving: "
    6564                  << std::setw (nesting - 1) << ' '
    66                   << object.name ().basename ()
     65                  << name
    6766                  << ", unresolved: "
    6867                  << unresolved.size ()
    69                   << (((*unresolved.begin ()).second)->object () ? " (resolved)" : "")
    7068                  << std::endl;
    7169
     
    9189          esi = symbols.find (urs.name ());
    9290          if (esi == symbols.end ())
    93             throw rld::error ("symbol referenced in '" + object.name ().basename () +
     91            throw rld::error ("symbol referenced in '" + name +
    9492                              "' not found: " + urs.name (), "resolving");
    9593          base = false;
     
    129127           oli != objects.end ();
    130128           ++oli)
    131         resolve (dependents, cache, base_symbols, symbols, *(*oli));
     129      {
     130        rld::files::object& object = *(*oli);
     131        if (rld::verbose () >= RLD_VERBOSE_INFO)
     132          std::cout << "resolver:resolving:    : "
     133                    << object.name ().basename () << std::endl;
     134        resolve_symbols (dependents, cache, base_symbols, symbols,
     135                         object.unresolved_symbols (),
     136                         object.name ().basename ());
     137      }
    132138
    133139      --nesting;
     
    147153      cache.get_objects (objects);
    148154
     155      /*
     156       * First resolve any undefined symbols that are forced by the linker or
     157       * the user.
     158       */
     159      resolver::resolve_symbols (dependents, cache, base_symbols, symbols,
     160                                 undefined, "undefines");
     161
     162      /*
     163       * Resolve the symbols in the object files.
     164       */
    149165      for (rld::files::object_list::iterator oi = objects.begin ();
    150166           oi != objects.end ();
     
    155171          std::cout << "resolver:resolving: top: "
    156172                    << object.name ().basename () << std::endl;
    157         resolve (dependents, cache, base_symbols, symbols, object);
     173        resolver::resolve_symbols (dependents, cache, base_symbols, symbols,
     174                                   object.unresolved_symbols (),
     175                                   object.name ().basename ());
    158176      }
    159177    }
Note: See TracChangeset for help on using the changeset viewer.