mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
* elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
g->global_gotsym is NULL.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2002-08-09 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
|
||||||
|
|
||||||
|
* elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if
|
||||||
|
g->global_gotsym is NULL.
|
||||||
|
|
||||||
2002-08-08 H.J. Lu <hjl@gnu.org>
|
2002-08-08 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* elflink.h (elf_add_default_symbol): Don't warn a defintion
|
* elflink.h (elf_add_default_symbol): Don't warn a defintion
|
||||||
|
@ -1446,15 +1446,18 @@ mips_elf_global_got_index (abfd, h)
|
|||||||
bfd_vma index;
|
bfd_vma index;
|
||||||
asection *sgot;
|
asection *sgot;
|
||||||
struct mips_got_info *g;
|
struct mips_got_info *g;
|
||||||
|
long global_got_dynindx = 0;
|
||||||
|
|
||||||
g = mips_elf_got_info (abfd, &sgot);
|
g = mips_elf_got_info (abfd, &sgot);
|
||||||
|
if (g->global_gotsym != NULL)
|
||||||
|
global_got_dynindx = g->global_gotsym->dynindx;
|
||||||
|
|
||||||
/* Once we determine the global GOT entry with the lowest dynamic
|
/* Once we determine the global GOT entry with the lowest dynamic
|
||||||
symbol table index, we must put all dynamic symbols with greater
|
symbol table index, we must put all dynamic symbols with greater
|
||||||
indices into the GOT. That makes it easy to calculate the GOT
|
indices into the GOT. That makes it easy to calculate the GOT
|
||||||
offset. */
|
offset. */
|
||||||
BFD_ASSERT (h->dynindx >= g->global_gotsym->dynindx);
|
BFD_ASSERT (h->dynindx >= global_got_dynindx);
|
||||||
index = ((h->dynindx - g->global_gotsym->dynindx + g->local_gotno)
|
index = ((h->dynindx - global_got_dynindx + g->local_gotno)
|
||||||
* MIPS_ELF_GOT_SIZE (abfd));
|
* MIPS_ELF_GOT_SIZE (abfd));
|
||||||
BFD_ASSERT (index < sgot->_raw_size);
|
BFD_ASSERT (index < sgot->_raw_size);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user