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.16.91.0.4/bfd/elf.c (+1 lines)
Lines 1212-1217 Link Here
1212
	    case DT_AUXILIARY: name = "AUXILIARY"; stringp = TRUE; break;
1212
	    case DT_AUXILIARY: name = "AUXILIARY"; stringp = TRUE; break;
1213
	    case DT_USED: name = "USED"; break;
1213
	    case DT_USED: name = "USED"; break;
1214
	    case DT_FILTER: name = "FILTER"; stringp = TRUE; break;
1214
	    case DT_FILTER: name = "FILTER"; stringp = TRUE; break;
1215
	    case DT_SUSE_HASHVALS: name = "SUSE_HASHVALS"; break;
1215
	    }
1216
	    }
1216
1217
1217
	  fprintf (f, "  %-11s ", name);
1218
	  fprintf (f, "  %-11s ", name);
(-)binutils-2.16.91.0.4/bfd/elflink.c (+46 lines)
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;
(-)binutils-2.16.91.0.4/include/bfdlink.h (+4 lines)
Lines 261-266 Link Here
261
     need much more time and therefore must be explicitly selected.  */
261
     need much more time and therefore must be explicitly selected.  */
262
  unsigned int optimize: 1;
262
  unsigned int optimize: 1;
263
263
264
  /* TRUE if we want to produced a section containing pre-computed
265
     hash values. This consumes more space. */
266
  unsigned int hashvals: 1;
267
264
  /* TRUE if ok to have multiple definition.  */
268
  /* TRUE if ok to have multiple definition.  */
265
  unsigned int allow_multiple_definition: 1;
269
  unsigned int allow_multiple_definition: 1;
266
270
(-)binutils-2.16.91.0.4/include/elf/common.h (+6 lines)
Lines 604-609 Link Here
604
#define DT_FILTER	0x7fffffff
604
#define DT_FILTER	0x7fffffff
605
605
606
606
607
/* Selected at random */
608
#define DT_SUSE_LO 0x6cbdd030
609
#define DT_SUSE_HASHVALS DT_SUSE_LO
610
#define DT_SUSE_DIRECT DT_SUSE_LO + 1
611
#define DT_SUSE_HI 0x6cbdd040
612
607
/* Values used in DT_FEATURE .dynamic entry.  */
613
/* Values used in DT_FEATURE .dynamic entry.  */
608
#define DTF_1_PARINIT	0x00000001
614
#define DTF_1_PARINIT	0x00000001
609
/* From
615
/* From
(-)binutils-2.16.91.0.4/ld/lexsup.c (+6 lines)
Lines 78-83 Link Here
78
  OPTION_EL,
78
  OPTION_EL,
79
  OPTION_EMBEDDED_RELOCS,
79
  OPTION_EMBEDDED_RELOCS,
80
  OPTION_EXPORT_DYNAMIC,
80
  OPTION_EXPORT_DYNAMIC,
81
  OPTION_HASHVALS,
81
  OPTION_HELP,
82
  OPTION_HELP,
82
  OPTION_IGNORE,
83
  OPTION_IGNORE,
83
  OPTION_MAP,
84
  OPTION_MAP,
Lines 341-346 Link Here
341
    '\0', NULL, NULL, ONE_DASH },
342
    '\0', NULL, NULL, ONE_DASH },
342
  { {"static", no_argument, NULL, OPTION_NON_SHARED},
343
  { {"static", no_argument, NULL, OPTION_NON_SHARED},
343
    '\0', NULL, NULL, ONE_DASH },
344
    '\0', NULL, NULL, ONE_DASH },
345
  { {"hashvals", no_argument, NULL, OPTION_HASHVALS},
346
    '\0', NULL, N_("Store pre-computed elf hash codes"), ONE_DASH },
344
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
347
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
345
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
348
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
346
  { {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
349
  { {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
Lines 1111-1116 Link Here
1111
	case OPTION_SYMBOLIC:
1114
	case OPTION_SYMBOLIC:
1112
	  link_info.symbolic = TRUE;
1115
	  link_info.symbolic = TRUE;
1113
	  break;
1116
	  break;
1117
	case OPTION_HASHVALS:
1118
	  link_info.hashvals = TRUE;
1119
	  break;
1114
	case 't':
1120
	case 't':
1115
	  trace_files = TRUE;
1121
	  trace_files = TRUE;
1116
	  break;
1122
	  break;

Return to bug 114008