binutils: backport a fix for broken relocation entries on mips with -fPIE, fixes...
[openwrt-10.03/.git] / toolchain / binutils / patches / 2.19.1 / 310-backport_fPIE_mips_fix.patch
1 --- a/bfd/elfxx-mips.c
2 +++ b/bfd/elfxx-mips.c
3 @@ -5670,9 +5670,9 @@ mips_elf_create_dynamic_relocation (bfd 
4  
5    /* We must now calculate the dynamic symbol table index to use
6       in the relocation.  */
7 -  if (h != NULL
8 -      && (!h->root.def_regular
9 -         || (info->shared && !info->symbolic && !h->root.forced_local)))
10 +  if (!(h == NULL
11 +       || (h->root.def_regular
12 +           && (info->executable || info->symbolic || h->root.forced_local))))
13      {
14        indx = h->root.dynindx;
15        if (SGI_COMPAT (output_bfd))