PR 11084
* dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no dynamic symbol table, use the normal symbol table. (Sized_dynobj::do_read_symbols): Remove assertion about type of symbol table.
This commit is contained in:
parent
6b7dd3f3b1
commit
abecea76bc
2 changed files with 31 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2010-01-08 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
|
PR 11084
|
||||||
|
* dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
|
||||||
|
dynamic symbol table, use the normal symbol table.
|
||||||
|
(Sized_dynobj::do_read_symbols): Remove assertion about type of
|
||||||
|
symbol table.
|
||||||
|
|
||||||
2010-01-08 Ian Lance Taylor <iant@google.com>
|
2010-01-08 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
PR 11072
|
PR 11072
|
||||||
|
|
|
@ -106,6 +106,7 @@ Sized_dynobj<size, big_endian>::find_dynsym_sections(
|
||||||
*pverneed_shndx = -1U;
|
*pverneed_shndx = -1U;
|
||||||
*pdynamic_shndx = -1U;
|
*pdynamic_shndx = -1U;
|
||||||
|
|
||||||
|
unsigned int symtab_shndx = 0;
|
||||||
unsigned int xindex_shndx = 0;
|
unsigned int xindex_shndx = 0;
|
||||||
unsigned int xindex_link = 0;
|
unsigned int xindex_link = 0;
|
||||||
const unsigned int shnum = this->shnum();
|
const unsigned int shnum = this->shnum();
|
||||||
|
@ -128,6 +129,9 @@ Sized_dynobj<size, big_endian>::find_dynsym_sections(
|
||||||
}
|
}
|
||||||
pi = NULL;
|
pi = NULL;
|
||||||
break;
|
break;
|
||||||
|
case elfcpp::SHT_SYMTAB:
|
||||||
|
symtab_shndx = i;
|
||||||
|
break;
|
||||||
case elfcpp::SHT_GNU_versym:
|
case elfcpp::SHT_GNU_versym:
|
||||||
pi = pversym_shndx;
|
pi = pversym_shndx;
|
||||||
break;
|
break;
|
||||||
|
@ -166,6 +170,25 @@ Sized_dynobj<size, big_endian>::find_dynsym_sections(
|
||||||
|
|
||||||
*pi = i;
|
*pi = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If there is no dynamic symbol table, use the normal symbol table.
|
||||||
|
// On some SVR4 systems, a shared library is stored in an archive.
|
||||||
|
// The version stored in the archive only has a normal symbol table.
|
||||||
|
// It has an SONAME entry which points to another copy in the file
|
||||||
|
// system which has a dynamic symbol table as usual. This is way of
|
||||||
|
// addressing the issues which glibc addresses using GROUP with
|
||||||
|
// libc_nonshared.a.
|
||||||
|
if (this->dynsym_shndx_ == -1U && symtab_shndx != 0)
|
||||||
|
{
|
||||||
|
this->dynsym_shndx_ = symtab_shndx;
|
||||||
|
if (xindex_shndx > 0 && xindex_link == symtab_shndx)
|
||||||
|
{
|
||||||
|
Xindex* xindex = new Xindex(this->elf_file_.large_shndx_offset());
|
||||||
|
xindex->read_symtab_xindex<size, big_endian>(this, xindex_shndx,
|
||||||
|
pshdrs);
|
||||||
|
this->set_xindex(xindex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the contents of section SHNDX. PSHDRS points to the section
|
// Read the contents of section SHNDX. PSHDRS points to the section
|
||||||
|
@ -337,7 +360,6 @@ Sized_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
|
||||||
// Get the dynamic symbols.
|
// Get the dynamic symbols.
|
||||||
typename This::Shdr dynsymshdr(pshdrs
|
typename This::Shdr dynsymshdr(pshdrs
|
||||||
+ this->dynsym_shndx_ * This::shdr_size);
|
+ this->dynsym_shndx_ * This::shdr_size);
|
||||||
gold_assert(dynsymshdr.get_sh_type() == elfcpp::SHT_DYNSYM);
|
|
||||||
|
|
||||||
sd->symbols = this->get_lasting_view(dynsymshdr.get_sh_offset(),
|
sd->symbols = this->get_lasting_view(dynsymshdr.get_sh_offset(),
|
||||||
dynsymshdr.get_sh_size(), true,
|
dynsymshdr.get_sh_size(), true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue