| 730 |
bfd_vma offset; |
bfd_vma offset; |
| 731 |
} tls_ldm_got; |
} tls_ldm_got; |
| 732 |
|
|
| 733 |
/* Small local sym to section mapping cache. */ |
/* Small local sym cache. */ |
| 734 |
struct sym_sec_cache sym_sec; |
struct sym_cache sym_cache; |
| 735 |
}; |
}; |
| 736 |
|
|
| 737 |
/* Get the s390 ELF linker hash table from a link_info structure. */ |
/* Get the s390 ELF linker hash table from a link_info structure. */ |
| 800 |
ret->sdynbss = NULL; |
ret->sdynbss = NULL; |
| 801 |
ret->srelbss = NULL; |
ret->srelbss = NULL; |
| 802 |
ret->tls_ldm_got.refcount = 0; |
ret->tls_ldm_got.refcount = 0; |
| 803 |
ret->sym_sec.abfd = NULL; |
ret->sym_cache.abfd = NULL; |
| 804 |
|
|
| 805 |
return &ret->elf.root; |
return &ret->elf.root; |
| 806 |
} |
} |
| 821 |
htab = elf_s390_hash_table (info); |
htab = elf_s390_hash_table (info); |
| 822 |
htab->sgot = bfd_get_section_by_name (dynobj, ".got"); |
htab->sgot = bfd_get_section_by_name (dynobj, ".got"); |
| 823 |
htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); |
htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); |
| 824 |
if (!htab->sgot || !htab->sgotplt) |
htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); |
| 825 |
|
if (!htab->sgot || !htab->sgotplt || !htab->srelgot) |
| 826 |
abort (); |
abort (); |
| 827 |
|
|
|
htab->srelgot = bfd_make_section_with_flags (dynobj, ".rela.got", |
|
|
(SEC_ALLOC | SEC_LOAD |
|
|
| SEC_HAS_CONTENTS |
|
|
| SEC_IN_MEMORY |
|
|
| SEC_LINKER_CREATED |
|
|
| SEC_READONLY)); |
|
|
if (htab->srelgot == NULL |
|
|
|| ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) |
|
|
return FALSE; |
|
| 828 |
return TRUE; |
return TRUE; |
| 829 |
} |
} |
| 830 |
|
|
| 1253 |
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL |
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL |
| 1254 |
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32) |
&& ELF32_R_TYPE (rel->r_info) != R_390_PC32) |
| 1255 |
|| (h != NULL |
|| (h != NULL |
| 1256 |
&& (! info->symbolic |
&& (! SYMBOLIC_BIND (info, h) |
| 1257 |
|| h->root.type == bfd_link_hash_defweak |
|| h->root.type == bfd_link_hash_defweak |
| 1258 |
|| !h->def_regular)))) |
|| !h->def_regular)))) |
| 1259 |
|| (ELIMINATE_COPY_RELOCS |
|| (ELIMINATE_COPY_RELOCS |
| 1294 |
easily. Oh well. */ |
easily. Oh well. */ |
| 1295 |
asection *s; |
asection *s; |
| 1296 |
void *vpp; |
void *vpp; |
| 1297 |
|
Elf_Internal_Sym *isym; |
| 1298 |
|
|
| 1299 |
s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, |
isym = bfd_sym_from_r_symndx (&htab->sym_cache, |
| 1300 |
sec, r_symndx); |
abfd, r_symndx); |
| 1301 |
if (s == NULL) |
if (isym == NULL) |
| 1302 |
return FALSE; |
return FALSE; |
| 1303 |
|
|
| 1304 |
|
s = bfd_section_from_elf_index (abfd, isym->st_shndx); |
| 1305 |
|
if (s == NULL) |
| 1306 |
|
s = sec; |
| 1307 |
|
|
| 1308 |
vpp = &elf_section_data (s)->local_dynrel; |
vpp = &elf_section_data (s)->local_dynrel; |
| 1309 |
head = (struct elf_s390_dyn_relocs **) vpp; |
head = (struct elf_s390_dyn_relocs **) vpp; |
| 1310 |
} |
} |
| 1563 |
|| h->needs_plt) |
|| h->needs_plt) |
| 1564 |
{ |
{ |
| 1565 |
if (h->plt.refcount <= 0 |
if (h->plt.refcount <= 0 |
| 1566 |
|| (! info->shared |
|| SYMBOL_CALLS_LOCAL (info, h) |
| 1567 |
&& !h->def_dynamic |
|| (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT |
| 1568 |
&& !h->ref_dynamic |
&& h->root.type != bfd_link_hash_undefweak)) |
|
&& h->root.type != bfd_link_hash_undefweak |
|
|
&& h->root.type != bfd_link_hash_undefined)) |
|
| 1569 |
{ |
{ |
| 1570 |
/* This case can occur if we saw a PLT32 reloc in an input |
/* This case can occur if we saw a PLT32 reloc in an input |
| 1571 |
file, but the symbol was never referred to by a dynamic |
file, but the symbol was never referred to by a dynamic |
| 1704 |
htab = elf_s390_hash_table (info); |
htab = elf_s390_hash_table (info); |
| 1705 |
|
|
| 1706 |
if (htab->elf.dynamic_sections_created |
if (htab->elf.dynamic_sections_created |
| 1707 |
&& h->plt.refcount > 0 |
&& h->plt.refcount > 0) |
|
&& (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT |
|
|
|| h->root.type != bfd_link_hash_undefweak)) |
|
| 1708 |
{ |
{ |
| 1709 |
/* Make sure this symbol is output as a dynamic symbol. |
/* Make sure this symbol is output as a dynamic symbol. |
| 1710 |
Undefined weak syms won't yet be marked as dynamic. */ |
Undefined weak syms won't yet be marked as dynamic. */ |
| 1833 |
|
|
| 1834 |
if (info->shared) |
if (info->shared) |
| 1835 |
{ |
{ |
| 1836 |
if (SYMBOL_REFERENCES_LOCAL (info, h)) |
if (SYMBOL_CALLS_LOCAL (info, h)) |
| 1837 |
{ |
{ |
| 1838 |
struct elf_s390_dyn_relocs **pp; |
struct elf_s390_dyn_relocs **pp; |
| 1839 |
|
|
| 2357 |
dyn = htab->elf.dynamic_sections_created; |
dyn = htab->elf.dynamic_sections_created; |
| 2358 |
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) |
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) |
| 2359 |
|| (info->shared |
|| (info->shared |
| 2360 |
&& (info->symbolic |
&& SYMBOL_REFERENCES_LOCAL (info, h)) |
|
|| h->dynindx == -1 |
|
|
|| h->forced_local) |
|
|
&& h->def_regular) |
|
| 2361 |
|| (ELF_ST_VISIBILITY (h->other) |
|| (ELF_ST_VISIBILITY (h->other) |
| 2362 |
&& h->root.type == bfd_link_hash_undefweak)) |
&& h->root.type == bfd_link_hash_undefweak)) |
| 2363 |
{ |
{ |
| 2527 |
&& r_type != R_390_PC16DBL |
&& r_type != R_390_PC16DBL |
| 2528 |
&& r_type != R_390_PC32DBL |
&& r_type != R_390_PC32DBL |
| 2529 |
&& r_type != R_390_PC32) |
&& r_type != R_390_PC32) |
| 2530 |
|| (h != NULL |
|| !SYMBOL_CALLS_LOCAL (info, h))) |
|
&& !SYMBOL_REFERENCES_LOCAL (info, h)))) |
|
| 2531 |
|| (ELIMINATE_COPY_RELOCS |
|| (ELIMINATE_COPY_RELOCS |
| 2532 |
&& !info->shared |
&& !info->shared |
| 2533 |
&& h != NULL |
&& h != NULL |
| 2569 |
|| r_type == R_390_PC32DBL |
|| r_type == R_390_PC32DBL |
| 2570 |
|| r_type == R_390_PC32 |
|| r_type == R_390_PC32 |
| 2571 |
|| !info->shared |
|| !info->shared |
| 2572 |
|| !info->symbolic |
|| !SYMBOLIC_BIND (info, h) |
| 2573 |
|| !h->def_regular)) |
|| !h->def_regular)) |
| 2574 |
{ |
{ |
| 2575 |
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); |
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); |
| 3251 |
The entry in the global offset table will already have been |
The entry in the global offset table will already have been |
| 3252 |
initialized in the relocate_section function. */ |
initialized in the relocate_section function. */ |
| 3253 |
if (info->shared |
if (info->shared |
| 3254 |
&& (info->symbolic |
&& SYMBOL_REFERENCES_LOCAL (info, h)) |
|
|| h->dynindx == -1 |
|
|
|| h->forced_local) |
|
|
&& h->def_regular) |
|
| 3255 |
{ |
{ |
| 3256 |
|
if (!h->def_regular) |
| 3257 |
|
return FALSE; |
| 3258 |
BFD_ASSERT((h->got.offset & 1) != 0); |
BFD_ASSERT((h->got.offset & 1) != 0); |
| 3259 |
rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); |
rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); |
| 3260 |
rela.r_addend = (h->root.u.def.value |
rela.r_addend = (h->root.u.def.value |