Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 114008 | Differences between
and this patch

Collapse All | Expand All

(-)binutils-2.25/bfd/elf.c (+1 lines)
Lines 1339-1344 Link Here
1339
	    case DT_USED: name = "USED"; break;
1339
	    case DT_USED: name = "USED"; break;
1340
	    case DT_FILTER: name = "FILTER"; stringp = TRUE; break;
1340
	    case DT_FILTER: name = "FILTER"; stringp = TRUE; break;
1341
	    case DT_GNU_HASH: name = "GNU_HASH"; break;
1341
	    case DT_GNU_HASH: name = "GNU_HASH"; break;
1342
	    case DT_SUSE_HASHVALS: name = "SUSE_HASHVALS"; break;
1342
	    }
1343
	    }
1343
1344
1344
	  fprintf (f, "  %-20s ", name);
1345
	  fprintf (f, "  %-20s ", name);
(-)binutils-2.25/bfd/elflink.c (+48 lines)
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
(-)binutils-2.25/include/bfdlink.h (+4 lines)
Lines 386-391 Link Here
386
     statics.  */
386
     statics.  */
387
  unsigned int task_link: 1;
387
  unsigned int task_link: 1;
388
388
389
  /* TRUE if we want to produced a section containing pre-computed
390
     hash values. This consumes more space. */
391
  unsigned int hashvals: 1;
392
389
  /* TRUE if ok to have multiple definition.  */
393
  /* TRUE if ok to have multiple definition.  */
390
  unsigned int allow_multiple_definition: 1;
394
  unsigned int allow_multiple_definition: 1;
391
395
(-)binutils-2.25/include/elf/common.h (+6 lines)
Lines 807-812 Link Here
807
#define DT_FILTER	0x7fffffff
807
#define DT_FILTER	0x7fffffff
808
808
809
809
810
/* Selected at random */
811
#define DT_SUSE_LO 0x6cbdd030
812
#define DT_SUSE_HASHVALS DT_SUSE_LO
813
#define DT_SUSE_DIRECT DT_SUSE_LO + 1
814
#define DT_SUSE_HI 0x6cbdd040
815
810
/* Values used in DT_FEATURE .dynamic entry.  */
816
/* Values used in DT_FEATURE .dynamic entry.  */
811
#define DTF_1_PARINIT	0x00000001
817
#define DTF_1_PARINIT	0x00000001
812
/* From
818
/* From
(-)binutils-2.25/ld/ldlex.h (+1 lines)
Lines 38-43 Link Here
38
  OPTION_EL,
38
  OPTION_EL,
39
  OPTION_EMBEDDED_RELOCS,
39
  OPTION_EMBEDDED_RELOCS,
40
  OPTION_EXPORT_DYNAMIC,
40
  OPTION_EXPORT_DYNAMIC,
41
  OPTION_HASHVALS,
41
  OPTION_NO_EXPORT_DYNAMIC,
42
  OPTION_NO_EXPORT_DYNAMIC,
42
  OPTION_HELP,
43
  OPTION_HELP,
43
  OPTION_IGNORE,
44
  OPTION_IGNORE,
(-)binutils-2.25/ld/lexsup.c (+5 lines)
Lines 271-276 Link Here
271
    '\0', NULL, NULL, ONE_DASH },
271
    '\0', NULL, NULL, ONE_DASH },
272
  { {"static", no_argument, NULL, OPTION_NON_SHARED},
272
  { {"static", no_argument, NULL, OPTION_NON_SHARED},
273
    '\0', NULL, NULL, ONE_DASH },
273
    '\0', NULL, NULL, ONE_DASH },
274
  { {"hashvals", no_argument, NULL, OPTION_HASHVALS},
275
    '\0', NULL, N_("Store pre-computed elf hash codes"), TWO_DASHES },
274
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
276
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
275
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
277
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
276
  { {"Bsymbolic-functions", no_argument, NULL, OPTION_SYMBOLIC_FUNCTIONS},
278
  { {"Bsymbolic-functions", no_argument, NULL, OPTION_SYMBOLIC_FUNCTIONS},
Lines 1154-1159 Link Here
1154
	case OPTION_SYMBOLIC_FUNCTIONS:
1156
	case OPTION_SYMBOLIC_FUNCTIONS:
1155
	  command_line.symbolic = symbolic_functions;
1157
	  command_line.symbolic = symbolic_functions;
1156
	  break;
1158
	  break;
1159
	case OPTION_HASHVALS:
1160
	  link_info.hashvals = TRUE;
1161
	  break;
1157
	case 't':
1162
	case 't':
1158
	  trace_files = TRUE;
1163
	  trace_files = TRUE;
1159
	  break;
1164
	  break;

Return to bug 114008