View | Details | Raw Unified | Return to bug 27924 | Differences between
and this patch

Collapse All | Expand All

(-)a/elf/dynamic-link.h (-1 / +5 lines)
Lines 84-90 elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], Link Here
84
	     __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; }  \
84
	     __typeof (((ElfW(Dyn) *) 0)->d_un.d_val) nrelative; int lazy; }  \
85
      ranges[2] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 } };			      \
85
      ranges[2] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 } };			      \
86
									      \
86
									      \
87
    if ((map)->l_info[DT_##RELOC])					      \
87
    /* With DT_RELR, DT_RELA/DT_REL can have zero value.  */		      \
88
    if ((map)->l_info[DT_##RELOC]					      \
89
	&& (map)->l_info[DT_##RELOC]->d_un.d_ptr != 0)			      \
88
      {									      \
90
      {									      \
89
	ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]);		      \
91
	ranges[0].start = D_PTR ((map), l_info[DT_##RELOC]);		      \
90
	ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val;	      \
92
	ranges[0].size = (map)->l_info[DT_##RELOC##SZ]->d_un.d_val;	      \
Lines 98-103 elf_machine_lazy_rel (struct link_map *map, struct r_scope_elem *scope[], Link Here
98
	ElfW(Addr) start = D_PTR ((map), l_info[DT_JMPREL]);		      \
100
	ElfW(Addr) start = D_PTR ((map), l_info[DT_JMPREL]);		      \
99
	ElfW(Addr) size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;	      \
101
	ElfW(Addr) size = (map)->l_info[DT_PLTRELSZ]->d_un.d_val;	      \
100
									      \
102
									      \
103
	if (ranges[0].start == 0)					      \
104
	  ranges[0].start = start;					      \
101
	if (ranges[0].start + ranges[0].size == (start + size))		      \
105
	if (ranges[0].start + ranges[0].size == (start + size))		      \
102
	  ranges[0].size -= size;					      \
106
	  ranges[0].size -= size;					      \
103
	if (!(do_lazy)							      \
107
	if (!(do_lazy)							      \
(-)a/elf/get-dynamic-info.h (-5 / +14 lines)
Lines 83-98 elf_get_dynamic_info (struct link_map *l, bool bootstrap, Link Here
83
      ADJUST_DYN_INFO (DT_PLTGOT);
83
      ADJUST_DYN_INFO (DT_PLTGOT);
84
      ADJUST_DYN_INFO (DT_STRTAB);
84
      ADJUST_DYN_INFO (DT_STRTAB);
85
      ADJUST_DYN_INFO (DT_SYMTAB);
85
      ADJUST_DYN_INFO (DT_SYMTAB);
86
      ADJUST_DYN_INFO (DT_RELR);
87
      ADJUST_DYN_INFO (DT_JMPREL);
88
      ADJUST_DYN_INFO (VERSYMIDX (DT_VERSYM));
89
      ADJUST_DYN_INFO (ADDRIDX (DT_GNU_HASH));
90
# undef ADJUST_DYN_INFO
91
92
      /* DT_RELA/DT_REL are mandatory.  But they may have zero value if
93
	 there is DT_RELR.  Don't relocate them if they are zero.  */
94
# define ADJUST_DYN_INFO(tag) \
95
      do								      \
96
	if (info[tag] != NULL && info[tag]->d_un.d_ptr != 0)		      \
97
         info[tag]->d_un.d_ptr += l_addr;				      \
98
      while (0)
99
86
# if ! ELF_MACHINE_NO_RELA
100
# if ! ELF_MACHINE_NO_RELA
87
      ADJUST_DYN_INFO (DT_RELA);
101
      ADJUST_DYN_INFO (DT_RELA);
88
# endif
102
# endif
89
# if ! ELF_MACHINE_NO_REL
103
# if ! ELF_MACHINE_NO_REL
90
      ADJUST_DYN_INFO (DT_REL);
104
      ADJUST_DYN_INFO (DT_REL);
91
# endif
105
# endif
92
      ADJUST_DYN_INFO (DT_RELR);
93
      ADJUST_DYN_INFO (DT_JMPREL);
94
      ADJUST_DYN_INFO (VERSYMIDX (DT_VERSYM));
95
      ADJUST_DYN_INFO (ADDRIDX (DT_GNU_HASH));
96
# undef ADJUST_DYN_INFO
106
# undef ADJUST_DYN_INFO
97
    }
107
    }
98
  if (info[DT_PLTREL] != NULL)
108
  if (info[DT_PLTREL] != NULL)
99
- 

Return to bug 27924