1 2010-01-06 Jakub Jelinek <jakub@redhat.com>
3 * src/arch-s390.c (s390_prelink_conflict_rela) <case R_390_PC32DBL>:
4 Ensure negative addends are sign-extended to 64-bits, instead of
7 2010-01-05 Jakub Jelinek <jakub@redhat.com>
9 * src/arch-s390.c (s390_prelink_rela, s390_apply_rela,
10 s390_prelink_conflict_rela, s390_prelink_conflict_rela,
11 s390_undo_prelink_rela, s390_reloc_size): Handle
12 R_390_{PC32DBL,16,PC16,PC16DBL,8} relocs.
14 2009-12-16 Jakub Jelinek <jakub@redhat.com>
16 * testsuite/reloc2.sh: Don't assume textrel works if getenforce
17 exists, but doesn't print Permissive or Disabled.
18 * testsuite/reloc8.sh: Likewise.
19 * testsuite/reloc9.sh: Likewise.
20 * testsuite/tls3.sh: Likewise.
22 2009-11-03 Jakub Jelinek <jakub@redhat.com>
24 * src/arch-x86_64.c (x86_64_reloc_size): Handle R_X86_64_IRELATIVE.
26 * src/prelink.h (R_PPC_IRELATIVE, R_PPC64_IRELATIVE,
27 R_PPC64_JMP_IREL): Define if not defined.
28 * src/undo.c (undo_sections, prelink_undo): Allow .iplt section to
29 change from SHT_NOBITS to SHT_PROGBITS.
30 * src/arch-ppc.c (ppc_adjust_rela, ppc_prelink_rela,
31 ppc_apply_conflict_rela, ppc_undo_prelink_rela): Handle
33 (ppc_prelink_conflict_rela): Handle R_PPC_IRELATIVE and
34 conflict->ifunc conflicts.
35 * src/arch-ppc64.c (ppc64_adjust_rela, ppc64_prelink_rela,
36 ppc64_undo_prelink_rela): Handle R_PPC64_IRELATIVE and
38 (ppc64_apply_conflict_rela, ppc64_reloc_size): Handle
40 (ppc64_prelink_conflict_rela): Handle R_PPC64_IRELATIVE,
41 R_PPC64_JMP_IREL and conflict->ifunc conflicts.
42 * testsuite/ifunc.h (IFUNC_ASM): Add powerpc definition.
44 (IFUNC): Use IFUNC_DECL.
46 2009-10-19 Joseph Myers <joseph@codesourcery.com>
48 * src/conflict.c (prelink_build_conflicts): Use >= not > to
49 determine whether a relocation points outside the first bss
52 * m4/libelf.m4: Resync with version of code in aclocal.m4.
54 2009-09-25 Jakub Jelinek <jakub@redhat.com>
56 * src/dwarf2.c (adjust_location_list) <case DW_OP_implicit_value>: Add
57 missing break statement.
59 2009-08-06 Joseph Myers <joseph@codesourcery.com>
61 * src/dwarf2.c (dwarf2_write_le64, dwarf2_write_be64): Shift by 56
64 2009-07-09 Jakub Jelinek <jakub@redhat.com>
66 * src/conflict.c (prelink_build_conflicts): Don't call
67 prelink_conflict_rel{,a} on .gnu.conflict section in executables.
69 2009-06-15 Jakub Jelinek <jakub@redhat.com>
71 * src/prelink.h (R_386_IRELATIVE, R_X86_64_IRELATIVE): Define
73 (struct PLArch): Add dest_addr argument to apply_conflict_rela
75 (struct prelink_conflict): Change used type from int to unsigned
76 char, add ifunc field.
77 (get_relocated_mem): Add dest_addr argument.
78 * src/get.c (prelink_record_relocations): Handle lookups resolving
79 to STT_GNU_IFUNC symbols.
80 * src/conflict.c (get_relocated_mem): Add dest_addr argument, pass
81 it through to the apply_conflict_rela hook. Fail if
82 apply_conflict_rela hook failed.
83 (prelink_build_conflicts): Build conflicts even in the executable,
84 and for libraries even if no conflicts were reported by the dynamic
85 linker. In the executable ignore any unused conflicts except for
86 ifunc conflicts. Adjust get_relocated_mem callers.
87 * src/cxx.c (remove_redundant_cxx_conflicts): Adjust
88 get_relocated_mem callers.
89 * arch-alpha.c (alpha_apply_conflict_rela): Add dest_addr argument.
90 (alpha_prelink_conflict_rela): Return early if info->dso == dso.
91 * arch-arm.c (arm_apply_conflict_rela): Add dest_addr argument.
92 (arm_prelink_conflict_rel, arm_prelink_conflict_rela): Return early
94 * arch-cris.c (cris_apply_conflict_rela): Add dest_addr argument.
95 (cris_prelink_conflict_rela): Return early if info->dso == dso.
96 * arch-ia64.c (ia64_apply_conflict_rela): Add dest_addr argument.
97 (ia64_prelink_conflict_rela): Return early if info->dso == dso.
98 * arch-ppc.c (ppc_apply_conflict_rela): Add dest_addr argument.
99 (ppc_prelink_conflict_rela): Return early if info->dso == dso.
100 * arch-ppc64.c (ppc64_apply_conflict_rela): Add dest_addr argument.
101 (ppc64_prelink_conflict_rela): Return early if info->dso == dso.
102 * arch-s390.c (s390_apply_conflict_rela): Add dest_addr argument.
103 (s390_prelink_conflict_rela): Return early if info->dso == dso.
104 * arch-s390x.c (s390x_apply_conflict_rela): Add dest_addr argument.
105 (s390x_prelink_conflict_rela): Return early if info->dso == dso.
106 * arch-sh.c (sh_apply_conflict_rela): Add dest_addr argument.
107 (sh_prelink_conflict_rela): Return early if info->dso == dso.
108 * arch-sparc.c (sparc_apply_conflict_rela): Add dest_addr argument.
109 (sparc_prelink_conflict_rela): Return early if info->dso == dso.
110 * arch-sparc64.c (sparc64_apply_conflict_rela): Add dest_addr argument.
111 (sparc64_prelink_conflict_rela): Return early if info->dso == dso.
112 * arch-mips.c (mipz_apply_conflict_rela): Add dest_addr argument.
113 (mips_prelink_conflict_reloc, mips_arch_prelink_conflict): Return
114 early if info->dso == dso.
115 * arch-i386.c (i386_adjust_rel, i386_adjust_rela, i386_prelink_rel,
116 i386_prelink_rela, i386_rel_to_rela, i386_undo_prelink_rel,
117 i386_rela_to_rel): Handle R_386_IRELATIVE.
118 (i386_apply_conflict_rela): Add dest_addr argument, handle
120 (i386_prelink_conflict_rel, i386_prelink_conflict_rela): Handle
121 R_386_IRELATIVE and conflict->ifunc conflicts.
122 * arch-x86_64.c (x86_64_adjust_rela, x86_64_prelink_rela,
123 x86_64_undo_prelink_rela): Handle R_X86_64_IRELATIVE.
124 (x86_64_apply_conflict_rela): Handle R_X86_64_IRELATIVE and
125 conflict->ifunc conflicts.
126 * testsuite/Makefile.am (TESTS): Add ifunc1.sh, ifunc2.sh and
128 * testsuite/Makefile.in: Regenerated.
129 * testsuite/ifunc1.sh: New test.
130 * testsuite/ifunc2.sh: New test.
131 * testsuite/ifunc3.sh: New test.
132 * testsuite/ifunc1.c: New file.
133 * testsuite/ifunc1lib1.c: New file.
134 * testsuite/ifunc1lib2.c: New file.
135 * testsuite/ifunc3.c: New file.
136 * testsuite/ifunc3lib1.c: New file.
137 * testsuite/ifunc.h: New file.
138 * testsuite/ifunctest.c: New file.
140 * src/Makefile.am (DEFS, AM_CFLAGS): Add -Wno-pointer-sign.
141 * src/Makefile.in: Regenerated.
142 * src/data.c (reopen_dso): Initialize data variable to avoid
145 * src/dwarf2.h (DW_TAG_condition, DW_TAG_shared_type): Define.
146 (DW_OP_form_tls_address, DW_OP_call_frame_cfa, DW_OP_bit_piece,
147 DW_OP_implicit_value, DW_OP_stack_value, DW_OP_GNU_uninit,
148 DW_OP_GNU_encoded_addr): Define.
149 (DW_ATE_packed_decimal, DW_ATE_numeric_string, DW_ATE_edited,
150 DW_ATE_signed_fixed, DW_ATE_unsigned_fixed, DW_ATE_decimal_float):
152 (DW_CFA_val_offset, DW_CFA_val_offset_sf, DW_CFA_val_expression):
154 (DW_LANG_PLI, DW_LANG_ObjC, DW_LANG_ObjC_plus_plus, DW_LANG_UPC,
156 * src/dwarf2.c (debug_sections): Add .debug_pubtypes.
157 (DEBUG_PUBTYPES): Define.
158 (DEBUG_MACINFO, DEBUG_LOC, DEBUG_STR, DEBUG_FRAME, DEBUG_RANGES):
160 (struct cu_data): Add cu_version field.
161 (read_abbrev): Adjust error messages not to be DWARF-2 specific.
162 (adjust_location_list): Likewise. Fix up DW_OP_call_ref handling,
163 handle DW_OP_form_tls_address, DW_OP_call_frame_cfa,
164 DW_OP_GNU_uninit, DW_OP_bit_piece, DW_OP_stack_value and
165 DW_OP_implicit_value.
166 (adjust_attributes): For cu->cu_version == 2 skip ptr_size bytes
167 instead of just 4. Adjust error messages not to be DWARF-2
169 (adjust_dwarf2_line): Handle version 3 of .debug_line.
170 (adjust_dwarf2_frame): Just that CIE version is 1 or 3, for
171 version 1 skip just one byte instead of uleb128 for return address
172 column. Handle DW_CFA_val_offset, DW_CFA_val_offset_sf and
173 DW_CFA_val_expression.
174 (adjust_dwarf2): Handle version 3 of .debug_info, initialize
175 cu.cu_version. Adjust error messages not to be DWARF-2 specific.
176 Note that .debug_pubtypes doesn't need adjustments.
178 2009-03-11 Jakub Jelinek <jakub@redhat.com>
180 * src/prelink.h (PLArch): Add rtype_class_valid field.
181 * src/get.c (prelink_record_relocations): If not /4, or
182 dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID
184 * src/cxx.c (remove_redundant_cxx_conflicts): Use
185 info->dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID.
186 * src/arch-ppc64.c (ppc64_reloc_class): For R_PPC64_COPY return
187 RTYPE_CLASS_COPY | RTYPE_CLASS_PLT, for non-TLS relocs return
189 (PL_ARCH): Set rtype_class_valid to RTYPE_CLASS_PLT.
190 * src/arch-alpha.c (PL_ARCH): Set rtype_class_valid to
192 * src/arch-arm.c (PL_ARCH): Likewise.
193 * src/arch-cris.c (PL_ARCH): Likewise.
194 * src/arch-i386.c (PL_ARCH): Likewise.
195 * src/arch-ia64.c (PL_ARCH): Likewise.
196 * src/arch-mips.c (PL_ARCH): Likewise.
197 * src/arch-ppc.c (PL_ARCH): Likewise.
198 * src/arch-s390.c (PL_ARCH): Likewise.
199 * src/arch-s390x.c (PL_ARCH): Likewise.
200 * src/arch-sh.c (PL_ARCH): Likewise.
201 * src/arch-sparc.c (PL_ARCH): Likewise.
202 * src/arch-sparc64.c (PL_ARCH): Likewise.
203 * src/arch-x86_64.c (PL_ARCH): Likewise.
205 2009-03-04 Joseph Myers <joseph@codesourcery.com>
207 * testsuite/reloc2.sh, testsuite/tls3.sh: Add ARM to architectures
208 requiring PIC shared libraries.
210 2009-03-04 Daniel Jacobowitz <dan@codesourcery.com>
211 Joseph Myers <joseph@codesourcery.com>
213 * src/arch-arm.c (arm_prelink_rel, arm_prelink_rela,
214 arm_prelink_conflict_rel, arm_prelink_conflict_rela, arm_rel_to_rela,
215 arm_rela_to_rel, arm_need_rel_to_rela, arm_undo_prelink_rel,
216 arm_reloc_class): Handle TLS relocations.
217 * src/prelink.h (R_ARM_TLS_DTPMOD32, R_ARM_TLS_DTPOFF32,
218 R_ARM_TLS_TPOFF32): Define if R_ARM_TLS_DTPMOD32 not already
221 2009-03-04 Daniel Jacobowitz <dan@codesourcery.com>
223 * src/arch-arm.c (arm_adjust_dyn, arm_adjust_rel, arm_adjust_rela,
224 arm_prelink_rel, arm_prelink_rela, arm_apply_conflict_rela,
225 arm_apply_rel, arm_apply_rela, arm_prelink_conflict_rela,
226 arm_rel_to_rela, arm_rela_to_rel, arm_need_rel_to_rela,
227 arm_arch_prelink, arm_arch_undo_prelink, arm_undo_prelink_rel):
228 Use endian-neutral functions.
230 2008-09-29 Joseph Myers <joseph@codesourcery.com>
232 * src/arch-sparc64.c (sparc64_prelink_rela,
233 sparc64_prelink_conflict_rela, sparc64_undo_prelink_rela,
234 sparc64_reloc_class): Handle TLS relocations.
235 (PL_ARCH): Update mmap_base and mmap_end for TASK_UNMAPPED_BASE
236 change to 0xfffff80100000000.
238 2007-12-04 Daniel Jacobowitz <dan@codesourcery.com>
240 * src/gather.c (gather_object): Print an error if nftw64 fails.
242 2007-10-09 Jakub Jelinek <jakub@redhat.com>
244 * src/cxx.c (remove_redundant_cxx_conflicts): Allow .sdata
247 * src/prelink.h (struct prelink_conflict): Add next2 field.
248 (struct prelink_conflicts): Add hash2 field.
249 * src/get.c (prelink_record_relocations): Clear next2 fields.
250 * src/prelink.c (free_info): Also free hash2 table.
251 * src/cxx.c (remove_redundant_cxx_conflicts): Populate hash2
252 if not populated yet, use it to speed up pltref checking.
254 * src/prelink.h (struct prelink_conflicts): New type.
255 (struct prelink_info): Change type of conflicts and curconflicts
256 fields to struct prelink_conflicts *.
257 * src/get.c (conflict_hash_init): New function.
258 (prelink_record_relocations): Adjust initialization of conflicts
259 array. If conflict linked lists has more than 15 entries, use
260 hash table with chains.
261 * src/prelink.c (free_info): Handle freeing conflict list using a hash
263 * src/fptr.c (opd_init): Only walk corresponding hash chain if
264 conflict list is using a hash table.
265 * src/conflict.c (prelink_conflict): Likewise.
266 (prelink_build_conflicts): Handle conflict list using a hash table.
267 * src/cxx.c (remove_redundant_cxx_conflicts): Likewise. Only walk
268 corresponding hash chain if conflict list is using a hash table.
270 * src/doit.c (find_ents): Clear e->u.tmp.
271 (clear_ent_marks, find_unlisted_dependency): Remove.
272 (prelink_ent): More efficient non-recursive check for
273 unlisted dependencies.
275 * src/cxx.c (find_cxx_sym): If fcs->lastndx != -1, search first
276 among symbols around it.
278 2007-10-08 Jakub Jelinek <jakub@redhat.com>
280 * src/space.c (find_readonly_space): Disallow section insertion in
281 between adjacent SHT_NOTE sections. When creating new PT_LOAD,
282 handle multiple consecutive SHT_NOTE sections with just one PT_NOTE
284 * testsuite/Makefile.am (TESTS): Add shuffle9.sh.
285 * testsuite/Makefile.in: Regenerated.
286 * testsuite/shuffle9.sh: New test.
287 * testsuite/shuffle9.c: New.
289 * testsuite/shuffle2.c: Add .previous at the end of __asm.
290 * testsuite/reloc5.c (main): Likewise.
292 * testsuite/tls3.sh: If libs aren't built with -fpic,
293 disable the test under SELinux in enforcing mode.
295 * src/cxx.c: Include alloca.h.
296 (specials): Moved out of remove_redundant_cxx_conflicts to toplevel.
297 Remove section fields.
298 (find_cxx_sym_valsize, find_cxx_sym_cache): New structs.
299 (struct find_cxx_sym): Add cache and lastndx fields.
300 (cachecmp, create_cache): New functions.
301 (find_cxx_sym): Add cache argument. If cache[n] is NULL, call
302 create_cache. Do a binary search in cache[n]->vals array instead
303 of always reading the whole symbol table.
304 (remove_redundant_cxx_conflicts): Adjust find_cxx_sym caller.
305 Check if secname is ".data" or ".data.rel.ro" instead of comparing
306 it against specials[k].secname. Use binary search in binsymcache
307 when doing check_pltref checks.
308 * testsuite/Makefile.am (TESTS): Add cxx2.sh.
309 * testsuite/Makefile.in: Regenerated.
310 * testsuite/cxx1.sh: Check that some conflicts are optimized out
311 by C++ optimizations.
312 * testsuite/cxx2.sh: New test.
313 * testsuite/cxx2.C: New.
315 2007-10-04 Jakub Jelinek <jakub@redhat.com>
317 * src/prelink.h (read_config): New prototype.
318 (gather_config, blacklist_from_config): Remove argument.
319 * src/gather.c (struct config_line): New type.
320 (config_lines, config_end): New variables.
321 (read_config): New function.
322 (gather_config, blacklist_from_config): Walk config_lines
323 chain instead of reading the config file.
324 * src/verify.c (prelink_verify): Call read_config. Don't
325 pass any argument to gather_config.
326 * src/main.c (main): Likewise. Also for blacklist_from_config.
327 * testsuite/quick2.sh: Use new -c etc/prelink.conf.d/*.conf
328 feature in prelink.conf and multiple config snippets.
330 2007-06-27 Jakub Jelinek <jakub@redhat.com>
332 * testsuite/reloc2.sh: If libs aren't built with -fpic,
333 disable the test under SELinux in enforcing mode.
335 2007-03-02 Sandra Loosemore <sandra@codesourcery.com>
337 * doc/prelink.8: Spelling and grammar fixes.
339 2006-12-01 Jakub Jelinek <jakub@redhat.com>
341 * src/verify.c (prelink_verify): Unlink ent->filename in case of
342 failures between closing the unprelinked dso and unlinking
345 2006-10-27 Jakub Jelinek <jakub@redhat.com>
347 * src/prelink.h (READWRITEPROTOSIZE): Undef after use.
349 2006-10-24 Richard Sandiford <richard@codesourcery.com>
351 * testsuite/tls3.sh: Use -fpic for MIPS too.
352 * testsuite/reloc2.sh: Likewise.
354 * testsuite/reloc4.sh: Use -mxgot when compiling for MIPS targets.
355 * testsuite/reloc5.c (main): Make the printed inline asm globalize
358 * testsuite/shuffle2.c (testzero): Globalize asm definition.
360 * src/Makefile.am (arch_SOURCES): Add arch-mips.c
361 * src/Makefile.in: Regenerate.
362 * src/arch-mips.c: New file.
364 * src/prelink.h (DT_MIPS_RLD_VERSION): Define.
365 (DT_MIPS_TIME_STAMP): Likewise.
366 (DT_MIPS_ICHECKSUM): Likewise.
367 (DT_MIPS_IVERSION): Likewise.
368 (DT_MIPS_FLAGS): Likewise.
369 (DT_MIPS_BASE_ADDRESS): Likewise.
370 (DT_MIPS_CONFLICT): Likewise.
371 (DT_MIPS_LIBLIST): Likewise.
372 (DT_MIPS_LOCAL_GOTNO): Likewise.
373 (DT_MIPS_CONFLICTNO): Likewise.
374 (DT_MIPS_LIBLISTNO): Likewise.
375 (DT_MIPS_SYMTABNO): Likewise.
376 (DT_MIPS_UNREFEXTNO): Likewise.
377 (DT_MIPS_GOTSYM): Likewise.
378 (DT_MIPS_HIPAGENO): Likewise.
379 (DT_MIPS_RLD_MAP): Likewise.
380 (R_MIPS_TLS_DTPMOD): Likewise.
381 (R_MIPS_TLS_DTPREL): Likewise.
382 (R_MIPS_TLS_TPREL): Likewise.
383 (R_MIPS_GLOB_DAT): Likewise.
384 (DSO): Add info_DT_MIPS_LOCAL_GOTNO, info_DT_MIPS_GOTSYM,
385 and info_DT_MIPS_SYMTABNO.
387 * src/dso.c (read_dynamic): Initialize the new DSO fields.
388 (adjust_symbol_p): Handle stub values on MIPS.
389 * src/prelink.c (prelink_prepare): Handle SHT_DYNAMIC and
390 SHT_MIPS_REGINFO on MIPS.
391 * src/space.c (find_readonly_space): Don't place the new section
392 in the PT_PHDR segment.
394 * src/prelink.h (data_iterator): New structure.
395 (init_data_iterator): Declare.
396 (get_data_from_iterator): Likewise.
397 (get_sym_from_iterator): Likewise.
398 * src/data.c (init_data_iterator): New function.
399 (get_data_from_iterator): Likewise.
400 (get_sym_from_iterator): Likewise.
402 * src/prelink.h (READWRITEPROTOSIZE): New macro. Instantiate
403 READWRITEPROTO for big and little endian. Add prototypes for
404 native-endian functions (buf_read_uneNN, read_uneNN, buf_write_neNN
405 and write_neNN). Replace uses of READWRITEPROTO with uses of
407 * src/data.c (BUFREADUNE, READUNE, WRITENE, BUFWRITENE): New macros.
408 (READWRITESIZE): New macro. Instantiate READWRITE for big and
409 little endian. Instantiate BUFREADUNE, READUNE, WRITENE
410 and BUFWRITENE. Replace uses of READWRITE with uses of this macro.
411 * src/arch-sh.c (read_une32, write_ne32, buf_write_ne32): Delete.
413 * src/prelink.h (PLArch): Add an arch_prelink_conflict callback.
414 * src/conflict.c (prelink_build_conflicts): If defined, call it
417 * src/prelink.h (PLArch): Make the arch_prelink callback take
418 a "struct prelink_info *" argument, not a "DSO *" argument.
419 * src/prelink.c (prelink): Adjust call accordingly.
420 * src/arch-alpha.c (alpha_arch_prelink): Adjust definition accordingly.
421 * src/arch-arm.c (arm_arch_prelink): Likewise.
422 * src/arch-cris.c (cris_arch_prelink): Likewise.
423 * src/arch-i386.c (i386_arch_prelink): Likewise.
424 * src/arch-ia64.c (ia64_arch_prelink): Likewise.
425 * src/arch-ppc.c (ppc_arch_prelink): Likewise.
426 * src/arch-s390.c (s390_arch_prelink): Likewise
427 * src/arch-s390x.c (s390x_arch_prelink): Likewise
428 * src/arch-sh.c (sh_arch_prelink): Likewise.
429 * src/arch-sparc64.c (sparc64_arch_prelink): Likewise.
430 * src/arch-sparc.c (sparc_arch_prelink): Likewise
431 * src/arch-x86_64.c (x86_64_arch_prelink): Likewise.
433 * src/prelink.h (PLArch): Add an arch_adjust callback.
434 * src/dso.c (adjust_dso): Use it, if defined.
436 * src/prelink.h (adjust_symbol_p): Declare.
437 * src/dso.c (adjust_symbol_p): New function, extracted from...
438 (adjust_symtab): ...here.
440 2006-10-27 Jakub Jelinek <jakub@redhat.com>
442 * src/dwarf2.c (adjust_dwarf2_ranges): Fix adjusting if end of range
443 is at the end of some section and there is padding before the
446 2006-07-28 Alexandre Oliva <aoliva@redhat.com>
448 * src/cache.c (deps_cmp): Avoid segfault if both a and b are NULL.
450 2001-05-24 Jakub Jelinek <jakub@redhat.com>