- // make nlist entries for all local symbols
- std::vector<const ld::Atom*>& localAtoms = this->_writer._localAtoms;
- std::vector<const ld::Atom*>& globalAtoms = this->_writer._exportedAtoms;
- _locals.reserve(localAtoms.size()+this->_state.stabs.size());
- this->_writer._localSymbolsStartIndex = 0;
- // make nlist entries for all debug notes
- _stabsIndexStart = symbolIndex;
- _stabsStringsOffsetStart = this->_writer._stringPoolAtom->currentOffset();
- for (std::vector<ld::relocatable::File::Stab>::const_iterator sit=this->_state.stabs.begin(); sit != this->_state.stabs.end(); ++sit) {
- macho_nlist<P> entry;
- entry.set_n_type(sit->type);
- entry.set_n_sect(sectionIndexForStab(*sit));
- entry.set_n_desc(sit->desc);
- entry.set_n_value(valueForStab(*sit));
- entry.set_n_strx(stringOffsetForStab(*sit, this->_writer._stringPoolAtom));
- _locals.push_back(entry);
- ++symbolIndex;
- }
- _stabsIndexEnd = symbolIndex;
- _stabsStringsOffsetEnd = this->_writer._stringPoolAtom->currentOffset();
- for (std::vector<const ld::Atom*>::const_iterator it=localAtoms.begin(); it != localAtoms.end(); ++it) {
- const ld::Atom* atom = *it;
- if ( this->addLocal(atom, this->_writer._stringPoolAtom) )
- this->_writer._atomToSymbolIndex[atom] = symbolIndex++;
- }
- this->_writer._localSymbolsCount = symbolIndex;
-