Lines 202-207
Link Here
|
202 |
|
202 |
|
203 |
flags = bed->dynamic_sec_flags; |
203 |
flags = bed->dynamic_sec_flags; |
204 |
|
204 |
|
|
|
205 |
if (info->hashvals) |
206 |
{ |
207 |
s = bfd_make_section (abfd, ".suse.hashvals"); |
208 |
if (s == NULL |
209 |
|| ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) |
210 |
|| ! bfd_set_section_alignment (abfd, s, 2)) |
211 |
return FALSE; |
212 |
} |
213 |
|
205 |
/* A dynamically linked executable has a .interp section, but a |
214 |
/* A dynamically linked executable has a .interp section, but a |
206 |
shared library does not. */ |
215 |
shared library does not. */ |
207 |
if (info->executable) |
216 |
if (info->executable) |
Lines 6417-6422
Link Here
|
6417 |
|
6426 |
|
6418 |
elf_hash_table (info)->bucketcount = 0; |
6427 |
elf_hash_table (info)->bucketcount = 0; |
6419 |
|
6428 |
|
|
|
6429 |
/* Create the direct bindings section - 1 entry per dynsym */ |
6430 |
s = bfd_get_section_by_name (dynobj, ".suse.hashvals"); |
6431 |
if (s) |
6432 |
{ |
6433 |
if (dynsymcount == 0) |
6434 |
s->flags |= SEC_EXCLUDE; |
6435 |
else |
6436 |
{ |
6437 |
s->size = dynsymcount * bed->s->sizeof_hash_entry; |
6438 |
s->contents = bfd_zalloc (output_bfd, s->size); |
6439 |
if (s->contents == NULL) |
6440 |
return FALSE; |
6441 |
memset (s->contents, 0xfe, s->size); |
6442 |
if (!_bfd_elf_add_dynamic_entry (info, DT_SUSE_HASHVALS, 0)) |
6443 |
return FALSE; |
6444 |
} |
6445 |
} |
6446 |
|
6420 |
/* Compute the size of the hashing table. As a side effect this |
6447 |
/* Compute the size of the hashing table. As a side effect this |
6421 |
computes the hash values for all the names we export. */ |
6448 |
computes the hash values for all the names we export. */ |
6422 |
if (info->emit_hash) |
6449 |
if (info->emit_hash) |
Lines 7417-7422
Link Here
|
7417 |
/* Array large enough to hold a section pointer for each local |
7444 |
/* Array large enough to hold a section pointer for each local |
7418 |
symbol of any input BFD. */ |
7445 |
symbol of any input BFD. */ |
7419 |
asection **sections; |
7446 |
asection **sections; |
|
|
7447 |
/* .suse.hashvals section */ |
7448 |
asection *hashvals_sec; |
7420 |
/* Buffer to hold swapped out symbols. */ |
7449 |
/* Buffer to hold swapped out symbols. */ |
7421 |
bfd_byte *symbuf; |
7450 |
bfd_byte *symbuf; |
7422 |
/* And one for symbol section indices. */ |
7451 |
/* And one for symbol section indices. */ |
Lines 9043-9048
Link Here
|
9043 |
bfd_put (8 * hash_entry_size, flinfo->output_bfd, chain, |
9072 |
bfd_put (8 * hash_entry_size, flinfo->output_bfd, chain, |
9044 |
((bfd_byte *) flinfo->hash_sec->contents |
9073 |
((bfd_byte *) flinfo->hash_sec->contents |
9045 |
+ (bucketcount + 2 + h->dynindx) * hash_entry_size)); |
9074 |
+ (bucketcount + 2 + h->dynindx) * hash_entry_size)); |
|
|
9075 |
|
9076 |
bfd_vma offset = hash_entry_size * h->dynindx; |
9077 |
if (offset > flinfo->hashvals_sec->size) |
9078 |
{ |
9079 |
fprintf (stderr, \ |
9080 |
"Out of bounds hashvals section index %d size %d\n", \ |
9081 |
(int) offset, (int) flinfo->hashvals_sec->size); |
9082 |
} |
9083 |
else |
9084 |
{ |
9085 |
bfd_put (8 * hash_entry_size, flinfo->output_bfd, \ |
9086 |
h->u.elf_hash_value, flinfo->hashvals_sec->contents + offset); |
9087 |
} |
9046 |
} |
9088 |
} |
9047 |
|
9089 |
|
9048 |
if (flinfo->symver_sec != NULL && flinfo->symver_sec->contents != NULL) |
9090 |
if (flinfo->symver_sec != NULL && flinfo->symver_sec->contents != NULL) |
Lines 10472-10477
Link Here
|
10472 |
flinfo.dynsym_sec = NULL; |
10514 |
flinfo.dynsym_sec = NULL; |
10473 |
flinfo.hash_sec = NULL; |
10515 |
flinfo.hash_sec = NULL; |
10474 |
flinfo.symver_sec = NULL; |
10516 |
flinfo.symver_sec = NULL; |
|
|
10517 |
flinfo.hashvals_sec = NULL; |
10475 |
} |
10518 |
} |
10476 |
else |
10519 |
else |
10477 |
{ |
10520 |
{ |
Lines 10480-10485
Link Here
|
10480 |
/* Note that dynsym_sec can be NULL (on VMS). */ |
10523 |
/* Note that dynsym_sec can be NULL (on VMS). */ |
10481 |
flinfo.symver_sec = bfd_get_linker_section (dynobj, ".gnu.version"); |
10524 |
flinfo.symver_sec = bfd_get_linker_section (dynobj, ".gnu.version"); |
10482 |
/* Note that it is OK if symver_sec is NULL. */ |
10525 |
/* Note that it is OK if symver_sec is NULL. */ |
|
|
10526 |
finfo.hashvals_sec = bfd_get_section_by_name (dynobj, ".suse.hashvals"); |
10483 |
} |
10527 |
} |
10484 |
|
10528 |
|
10485 |
flinfo.contents = NULL; |
10529 |
flinfo.contents = NULL; |
Lines 11291-11296
Link Here
|
11291 |
case DT_GNU_HASH: |
11335 |
case DT_GNU_HASH: |
11292 |
name = ".gnu.hash"; |
11336 |
name = ".gnu.hash"; |
11293 |
goto get_vma; |
11337 |
goto get_vma; |
|
|
11338 |
case DT_SUSE_HASHVALS: |
11339 |
name = ".suse.hashvals"; |
11340 |
goto get_vma; |
11294 |
case DT_STRTAB: |
11341 |
case DT_STRTAB: |
11295 |
name = ".dynstr"; |
11342 |
name = ".dynstr"; |
11296 |
goto get_vma; |
11343 |
goto get_vma; |
Lines 13062-13064
Link Here
|
13062 |
BFD_ASSERT (loc + bed->s->sizeof_rel <= s->contents + s->size); |
13109 |
BFD_ASSERT (loc + bed->s->sizeof_rel <= s->contents + s->size); |
13063 |
bed->s->swap_reloc_out (abfd, rel, loc); |
13110 |
bed->s->swap_reloc_out (abfd, rel, loc); |
13064 |
} |
13111 |
} |
|
|
13112 |
|