Lines 174-179
Link Here
|
174 |
|
174 |
|
175 |
flags = bed->dynamic_sec_flags; |
175 |
flags = bed->dynamic_sec_flags; |
176 |
|
176 |
|
|
|
177 |
if (info->hashvals) |
178 |
{ |
179 |
s = bfd_make_section (abfd, ".suse.hashvals"); |
180 |
if (s == NULL |
181 |
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) |
182 |
|| ! bfd_set_section_alignment (abfd, s, 2)) |
183 |
return FALSE; |
184 |
} |
185 |
|
177 |
/* A dynamically linked executable has a .interp section, but a |
186 |
/* A dynamically linked executable has a .interp section, but a |
178 |
shared library does not. */ |
187 |
shared library does not. */ |
179 |
if (info->executable) |
188 |
if (info->executable) |
Lines 5728-5733
Link Here
|
5728 |
memset (s->contents, 0, section_sym_count * bed->s->sizeof_sym); |
5737 |
memset (s->contents, 0, section_sym_count * bed->s->sizeof_sym); |
5729 |
} |
5738 |
} |
5730 |
|
5739 |
|
|
|
5740 |
/* Create the direct bindings section - 1 entry per dynsym */ |
5741 |
s = bfd_get_section_by_name (dynobj, ".suse.hashvals"); |
5742 |
if (s) |
5743 |
{ |
5744 |
if (dynsymcount == 0) |
5745 |
s->flags |= SEC_EXCLUDE; |
5746 |
else |
5747 |
{ |
5748 |
s->size = dynsymcount * bed->s->sizeof_hash_entry; |
5749 |
s->contents = bfd_zalloc (output_bfd, s->size); |
5750 |
if (s->contents == NULL) |
5751 |
return FALSE; |
5752 |
memset (s->contents, 0xfe, s->size); |
5753 |
if (!_bfd_elf_add_dynamic_entry (info, DT_SUSE_HASHVALS, 0)) |
5754 |
return FALSE; |
5755 |
} |
5756 |
} |
5757 |
|
5731 |
/* Compute the size of the hashing table. As a side effect this |
5758 |
/* Compute the size of the hashing table. As a side effect this |
5732 |
computes the hash values for all the names we export. */ |
5759 |
computes the hash values for all the names we export. */ |
5733 |
bucketcount = compute_bucket_count (info); |
5760 |
bucketcount = compute_bucket_count (info); |
Lines 5799-5804
Link Here
|
5799 |
/* Array large enough to hold a section pointer for each local |
5828 |
/* Array large enough to hold a section pointer for each local |
5800 |
symbol of any input BFD. */ |
5829 |
symbol of any input BFD. */ |
5801 |
asection **sections; |
5830 |
asection **sections; |
|
|
5831 |
/* .suse.hashvals section */ |
5832 |
asection *hashvals_sec; |
5802 |
/* Buffer to hold swapped out symbols. */ |
5833 |
/* Buffer to hold swapped out symbols. */ |
5803 |
bfd_byte *symbuf; |
5834 |
bfd_byte *symbuf; |
5804 |
/* And one for symbol section indices. */ |
5835 |
/* And one for symbol section indices. */ |
Lines 6614-6619
Link Here
|
6614 |
((bfd_byte *) finfo->hash_sec->contents |
6645 |
((bfd_byte *) finfo->hash_sec->contents |
6615 |
+ (bucketcount + 2 + h->dynindx) * hash_entry_size)); |
6646 |
+ (bucketcount + 2 + h->dynindx) * hash_entry_size)); |
6616 |
|
6647 |
|
|
|
6648 |
if (finfo->hashvals_sec) |
6649 |
{ |
6650 |
bfd_vma offset = hash_entry_size * h->dynindx; |
6651 |
if (offset > finfo->hashvals_sec->size) |
6652 |
fprintf (stderr, "Out of bounds hashvals section index %d size %d\n", |
6653 |
(int) offset, (int) finfo->hashvals_sec->size); |
6654 |
else |
6655 |
bfd_put (8 * hash_entry_size, finfo->output_bfd, |
6656 |
h->u.elf_hash_value, |
6657 |
finfo->hashvals_sec->contents + offset); |
6658 |
} |
6659 |
|
6617 |
if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) |
6660 |
if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) |
6618 |
{ |
6661 |
{ |
6619 |
Elf_Internal_Versym iversym; |
6662 |
Elf_Internal_Versym iversym; |
Lines 7786-7791
Link Here
|
7786 |
finfo.dynsym_sec = NULL; |
7829 |
finfo.dynsym_sec = NULL; |
7787 |
finfo.hash_sec = NULL; |
7830 |
finfo.hash_sec = NULL; |
7788 |
finfo.symver_sec = NULL; |
7831 |
finfo.symver_sec = NULL; |
|
|
7832 |
finfo.hashvals_sec = NULL; |
7789 |
} |
7833 |
} |
7790 |
else |
7834 |
else |
7791 |
{ |
7835 |
{ |
Lines 7794-7799
Link Here
|
7794 |
BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL); |
7838 |
BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL); |
7795 |
finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version"); |
7839 |
finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version"); |
7796 |
/* Note that it is OK if symver_sec is NULL. */ |
7840 |
/* Note that it is OK if symver_sec is NULL. */ |
|
|
7841 |
finfo.hashvals_sec = bfd_get_section_by_name (dynobj, ".suse.hashvals"); |
7797 |
} |
7842 |
} |
7798 |
|
7843 |
|
7799 |
finfo.contents = NULL; |
7844 |
finfo.contents = NULL; |
Lines 8533-8538
Link Here
|
8533 |
case DT_HASH: |
8578 |
case DT_HASH: |
8534 |
name = ".hash"; |
8579 |
name = ".hash"; |
8535 |
goto get_vma; |
8580 |
goto get_vma; |
|
|
8581 |
case DT_SUSE_HASHVALS: |
8582 |
name = ".suse.hashvals"; |
8583 |
goto get_vma; |
8536 |
case DT_STRTAB: |
8584 |
case DT_STRTAB: |
8537 |
name = ".dynstr"; |
8585 |
name = ".dynstr"; |
8538 |
goto get_vma; |
8586 |
goto get_vma; |