mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 02:44:48 +03:00
wip
This commit is contained in:
parent
d786c8a051
commit
134a52e6cc
2
mold.h
2
mold.h
@ -837,7 +837,7 @@ public:
|
|||||||
std::string_view shstrtab;
|
std::string_view shstrtab;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<Symbol<E>> local_syms;
|
std::unique_ptr<Symbol<E>[]> local_syms;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename E>
|
template <typename E>
|
||||||
|
@ -418,13 +418,13 @@ void ObjectFile<E>::initialize_symbols(Context<E> &ctx) {
|
|||||||
counter += elf_syms.size();
|
counter += elf_syms.size();
|
||||||
|
|
||||||
// Initialize local symbols
|
// Initialize local symbols
|
||||||
this->local_syms.resize(first_global);
|
this->local_syms.reset(new Symbol<E>[first_global]);
|
||||||
|
new (&this->local_syms[0]) Symbol<E>;
|
||||||
|
|
||||||
for (i64 i = 1; i < first_global; i++) {
|
for (i64 i = 1; i < first_global; i++) {
|
||||||
const ElfSym<E> &esym = elf_syms[i];
|
const ElfSym<E> &esym = elf_syms[i];
|
||||||
Symbol<E> &sym = this->local_syms[i];
|
Symbol<E> &sym = this->local_syms[i];
|
||||||
|
new (&sym) Symbol<E>(symbol_strtab.data() + esym.st_name);
|
||||||
sym.set_name(symbol_strtab.data() + esym.st_name);
|
|
||||||
|
|
||||||
if (sym.get_name().empty() && esym.st_type == STT_SECTION)
|
if (sym.get_name().empty() && esym.st_type == STT_SECTION)
|
||||||
if (InputSection<E> *sec = get_section(esym))
|
if (InputSection<E> *sec = get_section(esym))
|
||||||
|
Loading…
Reference in New Issue
Block a user