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-20101010/bfd/elf-bfd.h (+13 lines)
Lines 170-175 Link Here
170
     matters.  */
170
     matters.  */
171
  unsigned int pointer_equality_needed : 1;
171
  unsigned int pointer_equality_needed : 1;
172
172
173
  /* FIXME: these 2 bits consume another 4 bytes.  */
174
  /* Symbol is concrete, ie. non-vague if we can detect that, from the
175
     .direct section.  */
176
  unsigned int concrete_ref : 1;
177
  /* Symbol is certainly vague (if we can detect that), from the
178
     .direct section.  */
179
  unsigned int vague_ref : 1;
180
173
  /* String table index in .dynstr if this is a dynamic symbol.  */
181
  /* String table index in .dynstr if this is a dynamic symbol.  */
174
  unsigned long dynstr_index;
182
  unsigned long dynstr_index;
175
183
Lines 401-406 Link Here
401
  asection *tls_sec;
409
  asection *tls_sec;
402
  bfd_size_type tls_size;
410
  bfd_size_type tls_size;
403
411
412
  /* Direct linkage output section.  */
413
  asection *direct_sec;
414
404
  /* A linked list of BFD's loaded in the link.  */
415
  /* A linked list of BFD's loaded in the link.  */
405
  struct elf_link_loaded_list *loaded;
416
  struct elf_link_loaded_list *loaded;
406
417
Lines 1294-1299 Link Here
1294
     name actually used, which will be the DT_SONAME entry if there is
1305
     name actually used, which will be the DT_SONAME entry if there is
1295
     one.  */
1306
     one.  */
1296
  const char *dt_name;
1307
  const char *dt_name;
1308
  int         dt_needed_idx;
1297
1309
1298
  /* Records the result of `get_program_header_size'.  */
1310
  /* Records the result of `get_program_header_size'.  */
1299
  bfd_size_type program_header_size;
1311
  bfd_size_type program_header_size;
Lines 1394-1399 Link Here
1394
#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets)
1406
#define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets)
1395
#define elf_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents)
1407
#define elf_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents)
1396
#define elf_dt_name(bfd)	(elf_tdata(bfd) -> dt_name)
1408
#define elf_dt_name(bfd)	(elf_tdata(bfd) -> dt_name)
1409
#define elf_dt_needed_idx(bfd)	(elf_tdata(bfd) -> dt_needed_idx)
1397
#define elf_dyn_lib_class(bfd)	(elf_tdata(bfd) -> dyn_lib_class)
1410
#define elf_dyn_lib_class(bfd)	(elf_tdata(bfd) -> dyn_lib_class)
1398
#define elf_bad_symtab(bfd)	(elf_tdata(bfd) -> bad_symtab)
1411
#define elf_bad_symtab(bfd)	(elf_tdata(bfd) -> bad_symtab)
1399
#define elf_flags_init(bfd)	(elf_tdata(bfd) -> flags_init)
1412
#define elf_flags_init(bfd)	(elf_tdata(bfd) -> flags_init)
(-)binutils-20101010/bfd/elf.c (+2 lines)
Lines 1232-1237 Link Here
1232
	    case DT_RELCOUNT: name = "RELCOUNT"; break;
1232
	    case DT_RELCOUNT: name = "RELCOUNT"; break;
1233
	    case DT_FLAGS_1: name = "FLAGS_1"; break;
1233
	    case DT_FLAGS_1: name = "FLAGS_1"; break;
1234
	    case DT_VERSYM: name = "VERSYM"; break;
1234
	    case DT_VERSYM: name = "VERSYM"; break;
1235
	    case DT_SUSE_DIRECT: name = "SUSE_DIRECT"; break;
1235
	    case DT_VERDEF: name = "VERDEF"; break;
1236
	    case DT_VERDEF: name = "VERDEF"; break;
1236
	    case DT_VERDEFNUM: name = "VERDEFNUM"; break;
1237
	    case DT_VERDEFNUM: name = "VERDEFNUM"; break;
1237
	    case DT_VERNEED: name = "VERNEED"; break;
1238
	    case DT_VERNEED: name = "VERNEED"; break;
Lines 1586-1591 Link Here
1586
  table->runpath = NULL;
1587
  table->runpath = NULL;
1587
  table->tls_sec = NULL;
1588
  table->tls_sec = NULL;
1588
  table->tls_size = 0;
1589
  table->tls_size = 0;
1590
  table->direct_sec = NULL;
1589
  table->loaded = NULL;
1591
  table->loaded = NULL;
1590
  table->is_relocatable_executable = FALSE;
1592
  table->is_relocatable_executable = FALSE;
1591
1593
(-)binutils-20101010/bfd/elflink.c (+110 lines)
Lines 195-200 Link Here
195
      elf_hash_table (info)->eh_info.hdr_sec = s;
195
      elf_hash_table (info)->eh_info.hdr_sec = s;
196
    }
196
    }
197
197
198
  if ( info->direct && !info->executable )
199
    {
200
      s = bfd_make_section (abfd, ".suse.direct");
201
      if (s == NULL
202
	  || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
203
	  || ! bfd_set_section_alignment (abfd, s, 2))
204
	return FALSE;
205
      elf_hash_table (info)->direct_sec = s;
206
    }
207
198
  /* Create sections to hold version informations.  These are removed
208
  /* Create sections to hold version informations.  These are removed
199
     if they are not needed.  */
209
     if they are not needed.  */
200
  s = bfd_make_section_with_flags (abfd, ".gnu.version_d",
210
  s = bfd_make_section_with_flags (abfd, ".gnu.version_d",
Lines 2888-2893 Link Here
2888
2898
2889
      if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
2899
      if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
2890
	return -1;
2900
	return -1;
2901
      elf_dt_needed_idx (abfd) = ++(info->dt_needed_index);
2891
    }
2902
    }
2892
  else
2903
  else
2893
    /* We were just checking for existence of the tag.  */
2904
    /* We were just checking for existence of the tag.  */
Lines 3083-3088 Link Here
3083
  bfd_boolean add_needed;
3094
  bfd_boolean add_needed;
3084
  struct elf_link_hash_table *htab;
3095
  struct elf_link_hash_table *htab;
3085
  bfd_size_type amt;
3096
  bfd_size_type amt;
3097
  asection *direct_sec;
3098
  unsigned char *direct_data;
3086
  void *alloc_mark = NULL;
3099
  void *alloc_mark = NULL;
3087
  void *old_tab = NULL;
3100
  void *old_tab = NULL;
3088
  void *old_hash;
3101
  void *old_hash;
Lines 3096-3101 Link Here
3096
  htab = elf_hash_table (info);
3109
  htab = elf_hash_table (info);
3097
  bed = get_elf_backend_data (abfd);
3110
  bed = get_elf_backend_data (abfd);
3098
3111
3112
  direct_sec = NULL;
3113
  direct_data = NULL;
3114
3099
  if ((abfd->flags & DYNAMIC) == 0)
3115
  if ((abfd->flags & DYNAMIC) == 0)
3100
    dynamic = FALSE;
3116
    dynamic = FALSE;
3101
  else
3117
  else
Lines 3115-3120 Link Here
3115
	    bfd_set_error (bfd_error_wrong_format);
3131
	    bfd_set_error (bfd_error_wrong_format);
3116
	  goto error_return;
3132
	  goto error_return;
3117
	}
3133
	}
3134
      if (info->direct)
3135
	  direct_sec = bfd_get_section_by_name (abfd, ".suse.direct");
3136
      if (direct_sec != NULL)
3137
        {
3138
	  direct_data = bfd_alloc (abfd, direct_sec->size);
3139
	  if (direct_data == NULL
3140
	      || ! bfd_get_section_contents (abfd, direct_sec,
3141
					     direct_data, 0, direct_sec->size))
3142
	    goto error_return;
3143
	}
3118
    }
3144
    }
3119
3145
3120
  /* As a GNU extension, any input sections which are named
3146
  /* As a GNU extension, any input sections which are named
Lines 3822-3827 Link Here
3822
	      && vernum > 1
3848
	      && vernum > 1
3823
	      && definition)
3849
	      && definition)
3824
	    h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];
3850
	    h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];
3851
3852
        if (direct_sec != NULL)
3853
          {
3854
            unsigned long d_idx = isym - isymbuf;
3855
            unsigned long direct_entry;
3856
            d_idx += extsymoff;
3857
            d_idx *= 2;
3858
             BFD_ASSERT (d_idx <= bfd_get_section_size (direct_sec));
3859
            direct_entry = bfd_get_16 (abfd, direct_data + d_idx);
3860
            if ((direct_entry & DT_SUSE_DIRECT_VAGUE) != 0)
3861
              h->vague_ref = 1;
3862
            if (!h->vague_ref
3863
                 && (direct_entry & DT_SUSE_DIRECT_MASK) !=
3864
                                      DT_SUSE_DIRECT_UNKNOWN)
3865
              h->concrete_ref = 1;
3866
          }
3867
3825
	}
3868
	}
3826
3869
3827
      if (! (_bfd_generic_link_add_one_symbol
3870
      if (! (_bfd_generic_link_add_one_symbol
Lines 4490-4495 Link Here
4490
  if (isymbuf != NULL)
4533
  if (isymbuf != NULL)
4491
    free (isymbuf);
4534
    free (isymbuf);
4492
 error_return:
4535
 error_return:
4536
  if (direct_data != NULL)
4537
    free (direct_data);
4493
  return FALSE;
4538
  return FALSE;
4494
}
4539
}
4495
4540
Lines 5739-5744 Link Here
5739
	    return FALSE;
5784
	    return FALSE;
5740
	}
5785
	}
5741
5786
5787
      /* Create the direct bindings section - 1 entry per dynsym.  */
5788
      s = bfd_get_section_by_name (dynobj, ".suse.direct");
5789
      if (s != NULL)
5790
        {
5791
  	  if (dynsymcount == 0)
5792
            s->flags |= SEC_EXCLUDE;
5793
	  else
5794
	    {
5795
	      s->size = dynsymcount * sizeof (Elf_External_Direct);
5796
	      s->contents = bfd_zalloc (output_bfd, s->size);
5797
	      if (s->contents == NULL)
5798
	        return FALSE;
5799
	      memset (s->contents, 0xff, s->size);
5800
	      if (!_bfd_elf_add_dynamic_entry (info, DT_SUSE_DIRECT, 0))
5801
	        return FALSE;
5802
	    }
5803
	}
5804
5742
      /* Set the size of the .dynsym and .hash sections.  We counted
5805
      /* Set the size of the .dynsym and .hash sections.  We counted
5743
	 the number of dynamic symbols in elf_link_add_object_symbols.
5806
	 the number of dynamic symbols in elf_link_add_object_symbols.
5744
	 We will build the contents of .dynsym and .hash when we build
5807
	 We will build the contents of .dynsym and .hash when we build
Lines 5813-5818 Link Here
5813
  asection *hash_sec;
5876
  asection *hash_sec;
5814
  /* symbol version section (.gnu.version).  */
5877
  /* symbol version section (.gnu.version).  */
5815
  asection *symver_sec;
5878
  asection *symver_sec;
5879
  /* .direct linkage section.  */
5880
  asection *direct_sec;
5816
  /* Buffer large enough to hold contents of any section.  */
5881
  /* Buffer large enough to hold contents of any section.  */
5817
  bfd_byte *contents;
5882
  bfd_byte *contents;
5818
  /* Buffer large enough to hold external relocs of any section.  */
5883
  /* Buffer large enough to hold external relocs of any section.  */
Lines 6702-6707 Link Here
6702
	  eversym += h->dynindx;
6767
	  eversym += h->dynindx;
6703
	  _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
6768
	  _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
6704
	}
6769
	}
6770
6771
      if (finfo->direct_sec != NULL)
6772
	{
6773
	  int dt_index = DT_SUSE_DIRECT_UNKNOWN;
6774
	  bfd_vma offset = 2 * h->dynindx;
6775
         BFD_ASSERT (offset <= finfo->direct_sec->size);
6776
6777
	  if ((h->root.type == bfd_link_hash_defined
6778
	       || h->root.type == bfd_link_hash_defweak)
6779
	      && h->root.u.def.section != NULL
6780
	      && h->root.u.def.section->owner != NULL)
6781
	    {
6782
	      asection *sec = h->root.u.def.section;
6783
6784
	      dt_index = elf_dt_needed_idx (sec->owner);
6785
6786
	      if ((sec->owner->flags & DYNAMIC) == 0)
6787
		{
6788
		  if (sec->name == NULL
6789
		      || strncmp (sec->name, ".gnu.linkonce",
6790
			          sizeof ".gnu.linkonce" - 1) == 0)
6791
		    dt_index |= DT_SUSE_DIRECT_VAGUE;
6792
6793
		  /* app -> library data references get turned into copy
6794
		     relocs, so objects can migrate unpredictably into the
6795
		     application itself.  */
6796
		  else if (h->type == STT_OBJECT)
6797
		    dt_index |= DT_SUSE_DIRECT_VAGUE;
6798
		}
6799
	      else if (h->vague_ref)
6800
		dt_index |= DT_SUSE_DIRECT_VAGUE;
6801
6802
	      else if (!h->concrete_ref)
6803
		dt_index = DT_SUSE_DIRECT_UNKNOWN;
6804
6805
	    }
6806
	  bfd_put_16 (finfo->output_bfd,
6807
		      dt_index,
6808
		      finfo->direct_sec->contents + offset);
6809
	}
6705
    }
6810
    }
6706
6811
6707
  /* If we're stripping it, then it was just a dynamic symbol, and
6812
  /* If we're stripping it, then it was just a dynamic symbol, and
Lines 7836-7847 Link Here
7836
7941
7837
  if (! dynamic)
7942
  if (! dynamic)
7838
    {
7943
    {
7944
      finfo.direct_sec = NULL;
7839
      finfo.dynsym_sec = NULL;
7945
      finfo.dynsym_sec = NULL;
7840
      finfo.hash_sec = NULL;
7946
      finfo.hash_sec = NULL;
7841
      finfo.symver_sec = NULL;
7947
      finfo.symver_sec = NULL;
7842
    }
7948
    }
7843
  else
7949
  else
7844
    {
7950
    {
7951
      finfo.direct_sec = bfd_get_section_by_name (dynobj, ".suse.direct");
7845
      finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
7952
      finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
7846
      finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
7953
      finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
7847
      BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
7954
      BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
Lines 8602-8607 Link Here
8602
	    case DT_VERNEED:
8709
	    case DT_VERNEED:
8603
	      name = ".gnu.version_r";
8710
	      name = ".gnu.version_r";
8604
	      goto get_vma;
8711
	      goto get_vma;
8712
	    case DT_SUSE_DIRECT:
8713
	      name = ".suse.direct";
8714
	      goto get_vma;
8605
	    case DT_VERSYM:
8715
	    case DT_VERSYM:
8606
	      name = ".gnu.version";
8716
	      name = ".gnu.version";
8607
	    get_vma:
8717
	    get_vma:
(-)binutils-20101010/binutils/readelf.c (-2 / +138 lines)
Lines 145-150 Link Here
145
static int do_dynamic;
145
static int do_dynamic;
146
static int do_syms;
146
static int do_syms;
147
static int do_reloc;
147
static int do_reloc;
148
static int do_direct;
148
static int do_sections;
149
static int do_sections;
149
static int do_section_groups;
150
static int do_section_groups;
150
static int do_section_details;
151
static int do_section_details;
Lines 1481-1486 Link Here
1481
    case DT_SYMINFO:	return "SYMINFO"; /* aka ADDRRNGHI */
1482
    case DT_SYMINFO:	return "SYMINFO"; /* aka ADDRRNGHI */
1482
1483
1483
    case DT_VERSYM:	return "VERSYM";
1484
    case DT_VERSYM:	return "VERSYM";
1485
    case DT_SUSE_DIRECT:	return "SUSE_DIRECT";
1484
1486
1485
    case DT_TLSDESC_GOT: return "TLSDESC_GOT";
1487
    case DT_TLSDESC_GOT: return "TLSDESC_GOT";
1486
    case DT_TLSDESC_PLT: return "TLSDESC_PLT";
1488
    case DT_TLSDESC_PLT: return "TLSDESC_PLT";
Lines 2644-2649 Link Here
2644
  {"symbols",	       no_argument, 0, 's'},
2646
  {"symbols",	       no_argument, 0, 's'},
2645
  {"syms",	       no_argument, 0, 's'},
2647
  {"syms",	       no_argument, 0, 's'},
2646
  {"relocs",	       no_argument, 0, 'r'},
2648
  {"relocs",	       no_argument, 0, 'r'},
2649
  {"direct",	       no_argument, 0, 'y'},
2647
  {"notes",	       no_argument, 0, 'n'},
2650
  {"notes",	       no_argument, 0, 'n'},
2648
  {"dynamic",	       no_argument, 0, 'd'},
2651
  {"dynamic",	       no_argument, 0, 'd'},
2649
  {"arch-specific",    no_argument, 0, 'A'},
2652
  {"arch-specific",    no_argument, 0, 'A'},
Lines 2681-2686 Link Here
2681
      --symbols          An alias for --syms\n\
2684
      --symbols          An alias for --syms\n\
2682
  -n --notes             Display the core notes (if present)\n\
2685
  -n --notes             Display the core notes (if present)\n\
2683
  -r --relocs            Display the relocations (if present)\n\
2686
  -r --relocs            Display the relocations (if present)\n\
2687
  -y --direct            Display direct linkage table (if present)\n\
2684
  -u --unwind            Display the unwind info (if present)\n\
2688
  -u --unwind            Display the unwind info (if present)\n\
2685
  -d --dynamic           Display the dynamic section (if present)\n\
2689
  -d --dynamic           Display the dynamic section (if present)\n\
2686
  -V --version-info      Display the version sections (if present)\n\
2690
  -V --version-info      Display the version sections (if present)\n\
Lines 2770-2776 Link Here
2770
    usage ();
2774
    usage ();
2771
2775
2772
  while ((c = getopt_long
2776
  while ((c = getopt_long
2773
	  (argc, argv, "ersuahnldSDAINtgw::x:i:vVWH", options, NULL)) != EOF)
2777
	  (argc, argv, "erysuahnldSDAINtgw::x:i:vVWH", options, NULL)) != EOF)
2774
    {
2778
    {
2775
      char *cp;
2779
      char *cp;
2776
      int section;
2780
      int section;
Lines 2787-2792 Link Here
2787
	case 'a':
2791
	case 'a':
2788
	  do_syms++;
2792
	  do_syms++;
2789
	  do_reloc++;
2793
	  do_reloc++;
2794
	  do_direct++;
2790
	  do_unwind++;
2795
	  do_unwind++;
2791
	  do_dynamic++;
2796
	  do_dynamic++;
2792
	  do_header++;
2797
	  do_header++;
Lines 2820-2825 Link Here
2820
	case 'r':
2825
	case 'r':
2821
	  do_reloc++;
2826
	  do_reloc++;
2822
	  break;
2827
	  break;
2828
	case 'y':
2829
	  do_direct++;
2830
	  break;
2823
	case 'u':
2831
	case 'u':
2824
	  do_unwind++;
2832
	  do_unwind++;
2825
	  break;
2833
	  break;
Lines 3029-3035 Link Here
3029
  if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections
3037
  if (!do_dynamic && !do_syms && !do_reloc && !do_unwind && !do_sections
3030
      && !do_segments && !do_header && !do_dump && !do_version
3038
      && !do_segments && !do_header && !do_dump && !do_version
3031
      && !do_histogram && !do_debugging && !do_arch && !do_notes
3039
      && !do_histogram && !do_debugging && !do_arch && !do_notes
3032
      && !do_section_groups)
3040
      && !do_section_groups && !do_direct)
3033
    usage ();
3041
    usage ();
3034
  else if (argc < 3)
3042
  else if (argc < 3)
3035
    {
3043
    {
Lines 4667-4672 Link Here
4667
  return 1;
4675
  return 1;
4668
}
4676
}
4669
4677
4678
static void
4679
print_dt_needed_name (int idx)
4680
{
4681
  const char *name = NULL;
4682
  Elf_Internal_Dyn *entry;
4683
4684
  idx &= DT_SUSE_DIRECT_MASK;
4685
 
4686
  switch (idx)
4687
    {
4688
    case 0:
4689
      name = _("<self>");
4690
      break;
4691
    case DT_SUSE_DIRECT_UNKNOWN:
4692
      name = _("<unknown>");
4693
      break;
4694
    default:
4695
      idx--;
4696
4697
      for (entry = dynamic_section;
4698
	   entry < dynamic_section + dynamic_nent && idx > 0;
4699
	   entry++)
4700
	if (entry->d_tag == DT_NEEDED)
4701
	  idx--;
4702
  
4703
      if (idx == 0)
4704
        {
4705
          if (VALID_DYNAMIC_NAME (entry->d_un.d_val))
4706
	    name = GET_DYNAMIC_NAME (entry->d_un.d_val);
4707
	  else
4708
	    name = NULL;
4709
	}
4710
      break;
4711
    }
4712
4713
  if (!name)
4714
    name = _("<out-of-range>");
4715
  if (do_wide)
4716
    printf ("%s", name);
4717
  else
4718
    printf ("%-25s", name);
4719
}
4720
4721
static int
4722
process_direct (FILE *file)
4723
{
4724
  unsigned int i;
4725
  unsigned int si;
4726
  char *strtab;
4727
  unsigned char *directtab;
4728
  Elf_Internal_Sym *symtab = NULL;
4729
  Elf_Internal_Sym *psym;
4730
  Elf_Internal_Shdr *direct = NULL;
4731
  Elf_Internal_Shdr *dynsym = NULL;
4732
  Elf_Internal_Shdr *section;
4733
4734
  if (!do_direct)
4735
    return 1;
4736
  if (!dynamic_symbols || !dynamic_section || !dynamic_strings)
4737
    return 1;
4738
4739
  for (i = 0, section = section_headers;
4740
       i < elf_header.e_shnum;
4741
       i++, section++)
4742
    {
4743
      if (section->sh_type == SHT_DYNSYM)
4744
        dynsym = section;
4745
      if (!strcmp (SECTION_NAME (section), ".suse.direct"))
4746
        direct = section;
4747
    }
4748
  if (!dynsym || !direct)
4749
    return 1;
4750
  
4751
  symtab = GET_ELF_SYMBOLS (file, dynsym);
4752
  if (!symtab)
4753
    return 1;
4754
4755
  directtab = get_data (NULL, file, direct->sh_offset,
4756
			direct->sh_size, 1, _("direct linkage table"));
4757
  if (!symtab)
4758
  {
4759
    free (symtab);
4760
    return 1;
4761
  }
4762
4763
  if (dynsym->sh_link == elf_header.e_shstrndx)
4764
    strtab = string_table;
4765
  else
4766
    {
4767
      Elf_Internal_Shdr *string_sec;
4768
4769
      string_sec = SECTION_HEADER (dynsym->sh_link);
4770
4771
      strtab = get_data (NULL, file, string_sec->sh_offset,
4772
			 string_sec->sh_size, 1, _("string table"));
4773
    }
4774
4775
  assert (strtab != NULL);
4776
4777
  printf (_("\nDirect relocations for image:\n"));
4778
  printf (_("   Num:  Index     Vague   Binding                    Symbol\n"));
4779
  for (si = 0, psym = symtab;
4780
       si < dynsym->sh_size / dynsym->sh_entsize;
4781
       si++, psym++)
4782
    {
4783
       unsigned int field;
4784
       printf ("%6d: ", si);
4785
       field = byte_get (directtab + (si * 2), 2);
4786
       printf ("[0x%.4x]   ", field);
4787
       printf ("%s", (field & DT_SUSE_DIRECT_VAGUE) ? "Vague" : "     ");
4788
       printf ("  ");
4789
       print_dt_needed_name (field);
4790
       printf ("  ");
4791
       print_symbol (25, strtab + psym->st_name);
4792
       printf ("\n");
4793
    }
4794
4795
4796
  free (symtab);
4797
  if (strtab != string_table)
4798
    free (strtab);
4799
4800
  return 1;
4801
}
4802
4803
4670
/* Process the unwind section.  */
4804
/* Process the unwind section.  */
4671
4805
4672
#include "unwind-ia64.h"
4806
#include "unwind-ia64.h"
Lines 9003-9008 Link Here
9003
9137
9004
  process_relocs (file);
9138
  process_relocs (file);
9005
9139
9140
  process_direct (file);
9141
9006
  process_unwind (file);
9142
  process_unwind (file);
9007
9143
9008
  process_symbol_table (file);
9144
  process_symbol_table (file);
(-)binutils-20101010/include/bfdlink.h (+6 lines)
Lines 244-249 Link Here
244
  /* TRUE if BFD should pre-bind symbols in a shared object.  */
244
  /* TRUE if BFD should pre-bind symbols in a shared object.  */
245
  unsigned int symbolic: 1;
245
  unsigned int symbolic: 1;
246
246
247
  /* TRUE if BFD should bind symbols directly to resolved at link time.  */
248
  unsigned int direct: 1;
249
247
  /* TRUE if BFD should export all symbols in the dynamic symbol table
250
  /* TRUE if BFD should export all symbols in the dynamic symbol table
248
     of an executable, rather than only those used.  */
251
     of an executable, rather than only those used.  */
249
  unsigned int export_dynamic: 1;
252
  unsigned int export_dynamic: 1;
Lines 422-427 Link Here
422
425
423
  /* Start and end of RELRO region.  */
426
  /* Start and end of RELRO region.  */
424
  bfd_vma relro_start, relro_end;
427
  bfd_vma relro_start, relro_end;
428
429
  /* current max dtinfo section number.  */
430
  int dt_needed_index;
425
};
431
};
426
432
427
/* This structures holds a set of callback functions.  These are
433
/* This structures holds a set of callback functions.  These are
(-)binutils-20101010/include/elf/common.h (+5 lines)
Lines 648-653 Link Here
648
#define DF_BIND_NOW	(1 << 3)
648
#define DF_BIND_NOW	(1 << 3)
649
#define DF_STATIC_TLS	(1 << 4)
649
#define DF_STATIC_TLS	(1 << 4)
650
650
651
/* Constants for the DT_DIRECT entries.  */
652
#define DT_SUSE_DIRECT_VAGUE   (1<<15)
653
#define DT_SUSE_DIRECT_MASK     0xfff
654
#define DT_SUSE_DIRECT_UNKNOWN  DT_SUSE_DIRECT_MASK
655
651
/* These constants are used for the version number of a Elf32_Verdef
656
/* These constants are used for the version number of a Elf32_Verdef
652
   structure.  */
657
   structure.  */
653
658
(-)binutils-20101010/include/elf/external.h (+4 lines)
Lines 213-218 Link Here
213
  unsigned char		vd_next[4];
213
  unsigned char		vd_next[4];
214
} Elf_External_Verdef;
214
} Elf_External_Verdef;
215
215
216
typedef struct {
217
  unsigned char		dir_libidx[2];
218
} Elf_External_Direct;
219
216
/* This structure appears in a SHT_GNU_verdef section.  */
220
/* This structure appears in a SHT_GNU_verdef section.  */
217
221
218
typedef struct {
222
typedef struct {
(-)binutils-20101010/ld/lexsup.c (+6 lines)
Lines 71-76 Link Here
71
  OPTION_CREF,
71
  OPTION_CREF,
72
  OPTION_DEFSYM,
72
  OPTION_DEFSYM,
73
  OPTION_DEMANGLE,
73
  OPTION_DEMANGLE,
74
  OPTION_DIRECT,
74
  OPTION_DYNAMIC_LINKER,
75
  OPTION_DYNAMIC_LINKER,
75
  OPTION_SYSROOT,
76
  OPTION_SYSROOT,
76
  OPTION_EB,
77
  OPTION_EB,
Lines 342-347 Link Here
342
    '\0', NULL, NULL, ONE_DASH },
343
    '\0', NULL, NULL, ONE_DASH },
343
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
344
  { {"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
344
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
345
    '\0', NULL, N_("Bind global references locally"), ONE_DASH },
346
  { {"Bdirect", no_argument, NULL, OPTION_DIRECT},
347
    '\0', NULL, N_("Direct-linkage the the shared libraries"), ONE_DASH },
345
  { {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
348
  { {"check-sections", no_argument, NULL, OPTION_CHECK_SECTIONS},
346
    '\0', NULL, N_("Check section addresses for overlaps (default)"),
349
    '\0', NULL, N_("Check section addresses for overlaps (default)"),
347
    TWO_DASHES },
350
    TWO_DASHES },
Lines 747-752 Link Here
747
	      cplus_demangle_set_style (style);
750
	      cplus_demangle_set_style (style);
748
	    }
751
	    }
749
	  break;
752
	  break;
753
	case OPTION_DIRECT:
754
	  link_info.direct = TRUE;
755
	  break;
750
	case 'I':		/* Used on Solaris.  */
756
	case 'I':		/* Used on Solaris.  */
751
	case OPTION_DYNAMIC_LINKER:
757
	case OPTION_DYNAMIC_LINKER:
752
	  command_line.interpreter = optarg;
758
	  command_line.interpreter = optarg;

Return to bug 114008