blob: 41267ea0fd5241f93278c5f9798ce3e96a34380f [file] [log] [blame]
Roland McGrath13b69602008-04-01 02:30:05 +000012008-03-31 Roland McGrath <roland@redhat.com>
2
3 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
4 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
5 excuse a special section.
6
72008-03-27 Roland McGrath <roland@redhat.com>
8
9 * elflint.c (check_sections): Check that executability and writability
10 of sections is reflected in segment p_flags.
11
Roland McGrathd11f9cb2008-03-26 20:51:59 +0000122008-03-26 Roland McGrath <roland@redhat.com>
13
14 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
15 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
16 is valid in RELRO.
17
Roland McGrath47c5c352008-02-29 10:17:16 +0000182008-02-29 Roland McGrath <roland@redhat.com>
19
20 * readelf.c (print_attributes): Add a cast.
21 * elflint.c (check_attributes): Likewise.
22
23 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
24 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
25 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
26
Ulrich Drepper834de6f2008-02-23 06:50:01 +0000272008-02-03 Ulrich Drepper <drepper@redhat.com>
28
29 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
30 when linked into executable.
31 (elf_i386_create_relocations): Likewise.
32
Roland McGrath059c83e2008-02-21 06:19:39 +0000332008-02-20 Roland McGrath <roland@redhat.com>
34
35 * readelf.c (print_attributes): New function.
36 (process_elf_file): Call it under -A.
37
38 * elflint.c (check_attributes): Implement it for real.
39
402008-02-19 Roland McGrath <roland@redhat.com>
41
42 * elflint.c (special_sections): Handle .gnu.attributes section.
43 (check_sections): Likewise.
44 (check_attributes): New function.
45
462008-02-10 Roland McGrath <roland@redhat.com>
47
48 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
49 sections and ET_REL files.
50
Ulrich Drepper712d78e2008-02-02 10:01:53 +0000512008-02-02 Ulrich Drepper <drepper@redhat.com>
52
53 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
54 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
55 and R_386_TLS_LE.
56 (elf_i386_create_relocations): Likewise.
57 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
58 elements.
59 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
60 (ld_generic_create_outfile): Add PT_TLS entry to program header.
61 Fix generation of PT_GNU_STACK entry.
62
Ulrich Drepperc54785a2008-02-01 18:05:21 +0000632008-02-01 Ulrich Drepper <drepper@redhat.com>
64
Ulrich Drepper7cd1bf72008-02-01 23:52:59 +000065 * ld.c (replace_args): Prevent loop over replacements if the parameter
66 is only two characters long.
67
Ulrich Drepperc54785a2008-02-01 18:05:21 +000068 * ld.c: Recognize sha1 argument for --build-id parameter.
69 * ldgeneric.c (create_build_id_section): Handle sha1.
70 (compute_hash_sum): New function. Broken out of compute_build_id.
71 Take hash function and context as parameters.
72 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
73 implementation.
74
Ulrich Drepper89759c72008-01-31 19:44:12 +0000752008-01-31 Ulrich Drepper <drepper@redhat.com>
76
77 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
78 * ld.c: Recognize --build-id command line parameter.
79 * ld.h: Define scn_dot_note_gnu_build_id.
80 (struct ld_state): Add build_id and buildidscnidx elements.
81 * ldgeneric.c: Implement --build-id command line parameter.
82 * ldlex.l (ID): Recognize - as valid character after the first one.
83
Ulrich Drepper5530ec52008-01-29 10:42:07 +0000842008-01-29 Ulrich Drepper <drepper@redhat.com>
85
Ulrich Drepperb61c4cc2008-01-30 07:16:28 +000086 * ld.c (replace_args): New function.
87 (main): Use it to rewrite old-style parameters.
88
Ulrich Dreppered9b6cb2008-01-30 06:33:33 +000089 * elf32-i386.script: Add .gnu.hash section.
90 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
91 (fillin_special_symbol): Initialize st_size.
92 (sortfct_hashval): New function.
93 (create_gnu_hash): New function.
94 (create_hash): New function.
95 (ld_generic_create_outfile): Use the new functions to create the
96 hash tables.
97
Ulrich Drepper5530ec52008-01-29 10:42:07 +000098 * elflint.c (check_gnu_hash): Fix index value printed in error message.
99
Ulrich Drepper0e864dd2008-01-25 00:18:42 +00001002008-01-24 Ulrich Drepper <drepper@redhat.com>
101
102 * elflint.c (check_group): Check that signature symbol for section
103 group is not an empty string.
104 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
105 section. Start implementation of --hash-style.
106 * i386_ld.c: Likewise.
107 * ld.c: Recognize --hash-style.
108 * ld.h (struct scninfo): Add comdat_group.
109 Add additional parameter to finalize_plt callback.
110
Ulrich Drepper5449a6b2008-01-22 15:49:39 +00001112008-01-22 Ulrich Drepper <drepper@redhat.com>
112
113 * ld.h (struct callbacks): Add initialize_gotplt.
114 (struct scnhead): Add scn_dot_gotplt.
115 (struct ld_state): Add gotpltscnidx.
116 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
117 (elf_i386_initialize_pltrel): Likewise.
118 (elf_i386_initialize_got): There is now a separate .got.plt, so
119 don't do the PLT-related work here. Initialize d_type.
120 (elf_i386_initialize_gotplt): New function.
121 (elf_i386_plt0): Use ud2a after indirect jump.
122 (elf_i386_pic_plt0_entry): Likewise.
123 (elf_i386_finalize_plt): Reference now .got.plt.
124 (elf_i386_count_relocations): For GOT entries which need no relocation
125 don't bump nrel_got.
126 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
127 handling for split .got/.got.plt.
128 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
129 * elf32-i386.script: Sort sections for security. There are no .got
130 input sections. Add .got.plt.
131 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
132 (ld_generic_create_outfile): Initialize .got.plt section.
133 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
134
Ulrich Drepperd9488292008-01-20 16:43:15 +00001352008-01-19 Ulrich Drepper <drepper@redhat.com>
136
137 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
138 symbols are not carried over into statically linked output files.
139 Add dummy entries for more TLS relocations.
140
141 * ld.c (options): Add long names for -( and -).
142
143 * ldgeneric.c (check_definition): For newly found definitions don't
144 mark section as used if symbol is absolute.
145 (extract_from_archive): Only assign archive sequence number the first
146 time the archive is handled. Update ld_state.last_archive_used
147 if any symbol was used. Remove nround variable.
148 (file_process2): When using symbol from an archive, update
149 ld_state.group_start_archive, ld_state.archives, and
150 ld_state.tailarchives.
151 (ld_generic_file_process): If group is not handled anymore, after
152 freeing ELF handles for the archives, clear ld_state.archives and
153 *nextp. Fix wrong logic in recognizing first iteration of group
154 loop. When clearing flags, also clear ld_state.group_start_archive.
155
Ulrich Drepper5eee1222008-01-11 10:12:18 +00001562008-01-11 Ulrich Drepper <drepper@redhat.com>
157
158 * objdump.c (show_disasm): Adjust disassembler format string for
159 removal of %e.
160
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00001612008-01-04 Roland McGrath <roland@redhat.com>
162
Roland McGrath059c83e2008-02-21 06:19:39 +0000163 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
164 a size greater than the items cover means multiple sets of items.
165 (handle_core_note): Update caller.
166
1672008-01-04 Roland McGrath <roland@redhat.com>
168
Ulrich Dreppere219f1c2008-01-09 05:49:49 +0000169 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
170
1712008-01-03 Roland McGrath <roland@redhat.com>
172
173 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
174
175 * elflint.c (check_dynamic): Remove duplicate initializer.
176
Ulrich Drepperad024af2008-01-02 17:42:52 +00001772008-01-02 Ulrich Drepper <drepper@redhat.com>
178
179 * addr2line.c: Update copyright year.
180 * ar.c: Likewise.
181 * elfcmp.c: Likewise.
182 * elflint.c: Likewise.
183 * findtextrel.c: Likewise.
184 * ld.c: Likewise.
185 * nm.c: Likewise.
186 * objdump.c: Likewise.
187 * ranlib.c: Likewise.
188 * readelf.c: Likewise.
189 * size.c: Likewise.
190 * strings.c: Likewise.
191 * strip.c: Likewise.
192 * unstrip.c: Likewise.
193
Ulrich Drepper3cbdd382008-01-02 17:44:39 +00001942007-12-30 Ulrich Drepper <drepper@redhat.com>
195
196 * objdump (show_disasm): Use %e after third parameter.
197
1982007-12-21 Ulrich Drepper <drepper@redhat.com>
199
200 * strip.c: Fix wrong parenthesis in a few branch predictions.
201 * strings.c: Likewise.
202
2032007-12-20 Ulrich Drepper <drepper@redhat.com>
204
205 * Makefile.am (DEFS): Add DEBUGPRED.
206 * addr2line.c: Include debugpred.h.
207 * ar.c: Likewise.
208 * elfcmp.c: Likewise.
209 * elflint.c: Likewise.
210 * findtextrel.c: Likewise.
211 * nm.c: Likewise.
212 * objdump.c: Likewise.
213 * ranlib.c: Likewise.
214 * readelf.c: Likewise.
215 * size.c: Likewise.
216 * strings.c: Likewise.
217 * strip.c: Likewise.
218 * unstrip.c: Likewise.
219 * debugpred.h: New file.
220
221 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
222 (handle_relocs_rela): Likewise.
223
224 * readelf.c: Add lots of likely/unlikely.
225
226 * elflint.c: Minor cleanups.
227
Roland McGrath1a2e8f42007-12-15 23:39:34 +00002282007-11-19 Roland McGrath <roland@redhat.com>
229
230 * readelf.c (print_ops): Handle all bad op codes gracefully.
231 Print their numbers instead of just ???.
232
Roland McGrath07a696e2007-11-09 22:44:26 +00002332007-11-09 Roland McGrath <roland@redhat.com>
234
235 * readelf.c (attr_callback): Handle DW_AT_data_location.
Roland McGrath1a2e8f42007-12-15 23:39:34 +0000236 Handle block forms to mean a DWARF expression for DW_AT_allocated,
237 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
238 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
239 DW_AT_upper_bound.
Roland McGrath07a696e2007-11-09 22:44:26 +0000240
Roland McGrathe4c22ea2007-10-23 13:07:39 +00002412007-10-20 Roland McGrath <roland@redhat.com>
242
243 * unstrip.c (options): Update -R description.
244 (struct symbol): Put symbol details a union with a size_t pointer
245 `duplicate'.
246 (compare_symbols_output): Use null ->name as marker for discard
247 symbols, not zero *->map.
248 (copy_elided_sections): Record forwarding pointers for discarded
249 duplicates and fill SYMNDX_MAP elements through them.
250
251 * readelf.c (process_file): Set offline_next_address to 0 at start.
252 (struct process_dwflmod_args): New type.
253 (process_dwflmod): Take args in it, pass fd to process_elf_file.
254 (process_file): Update caller; dup FD for passing to libdwfl.
255 (process_elf_file): Take new arg FD. For ET_REL file when
256 displaying data affected by libdwfl relocation, open a new Elf handle.
257
2582007-10-17 Roland McGrath <roland@redhat.com>
259
260 * readelf.c (print_debug_line_section): For invalid data inside a
261 unit with plausible length, keep printing at the next unit boundary.
262
263 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
264
2652007-10-16 Roland McGrath <roland@redhat.com>
266
267 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
268
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00002692007-10-15 Roland McGrath <roland@redhat.com>
270
271 * make-debug-archive.in: New file.
272 * Makefile.am (EXTRA_DIST): Add it.
273 (make-debug-archive): New target.
274 (bin_SCRIPTS, CLEANFILES): Add it.
275
2762007-10-10 Roland McGrath <roland@redhat.com>
277
278 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
279 Use it to check MERGE|STRINGS for .debug_str.
280 (check_sections): Handle exact_or_gnuld.
281
2822007-10-08 Roland McGrath <roland@redhat.com>
283
284 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
285 64-bit struct timeval with 32-bit tv_usec.
286
2872007-10-07 Roland McGrath <roland@redhat.com>
288
289 * readelf.c (check_archive_index): New function.
290 (process_file): Call it. Change signature to take only fd and name.
291 Use libdwfl to open the file, then iterate on its modules (multiple
292 for an archive) to print file name and call process_elf_file.
293 (main): Update caller. Let process_file do elf_begin.
294 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
295 (process_elf_file): Take only Dwfl_Module * argument.
296 Don't print the file name here.
297 (print_debug_*_section): Take Dwfl_Module * argument.
298 (print_debug): Likewise. Update caller.
299 (format_dwarf_addr): New function.
300 (print_debug_ranges_section): Use it.
301 (attr_callback): Likewise.
302 (print_debug_line_section, print_debug_loc_section): Likewise.
303
304 * readelf.c (print_debug_ranges_section): Translate all strings.
305 (print_debug_loc_section): Likewise.
306
307 * unstrip.c (copy_elided_sections): Initialize SEC.
308
309 * ar.c (do_oper_insert): Put trailing / on short names.
310
311 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
312
313 * arlib2.c (arlib_add_long_name): Adjust for header size.
314
315 * arlib.c (arlib_finalize): Pad long name table to keep size even.
316
317 * ar.c (do_oper_insert): Use write_retry for padding write.
318
319 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
320 Unconditionally set FOUND[CNT]->elf when setting ->mem.
321 (remember_long_name): New function.
322 (do_oper_insert): Call it. Correctly use length of basename,
323 not original name. Don't store long name twice for new member.
324
3252007-10-06 Roland McGrath <roland@redhat.com>
326
327 * elflint.c (check_note): Skip empty segment.
328 (check_note_section): Skip empty section.
329
330 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
331 (handle_output_dir_module, handle_implicit_modules): Pass it down.
332 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
333 (compare_alloc_sections): Take new arg REL, ignore address if true.
334 (compare_sections): Likewise, pass it down.
335 (compare_sections_rel, compare_sections_nonrel): New functions.
336 (find_alloc_sections_prelink, copy_elided_sections): Use them
337 instead of compare_sections.
338 (sections_match): New function, broken out of ...
339 (find_alloc_section): ... here.
340 (copy_elided_sections): Reorganize section match-up logic.
341 Use sections_match for SHF_ALLOC in ET_REL.
342 For ET_REL, let the nonzero sh_addr from the debug file dominate.
343
344 * unstrip.c (add_new_section_symbols): Take new arg REL.
345 When true, do not update section symbol values.
346 (collect_symbols): Likewise. Update section symbols with address
347 of chosen output section, not original section.
348 (check_symtab_section_symbols, copy_elided_sections): Update callers.
349
350 * unstrip.c (compare_alloc_sections): At the same address, preserve
351 original section order.
352
353 * elflint.c (special_sections): Don't require MERGE|STRINGS for
354 .debug_str, it didn't always have them with older tools.
355
356 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
357
3582007-10-05 Roland McGrath <roland@redhat.com>
359
360 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
361 ET_REL file.
362
363 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
364 SHN_UNDEF as "bad section". Use shndx value in messages.
365
366 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
367 for ".debug" so it matches as a prefix.
368 (IS_KNOWN_SPECIAL): New macro.
369 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
370 type even under -d, for a .debug* or .shstrtab section.
371
372 * readelf.c (print_ops): Use hex for address operand.
373
3742007-10-04 Roland McGrath <roland@redhat.com>
375
376 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
377 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
378 sections mapped to SHN_UNDEF.
379
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00003802007-10-04 Ulrich Drepper <drepper@redhat.com>
381
382 * readelf.c (dump_archive_index): Avoid warning about uninitialized
383 variable with older glibc versions.
384 Add some branch prediction.
385
Roland McGrath59ea7f32007-10-04 08:50:09 +00003862007-10-04 Roland McGrath <roland@redhat.com>
387
388 * readelf.c (print_archive_index): New variable.
389 (options, parse_opt): Accept -c/--archive-index to set it.
390 (dump_archive_index): New function.
391 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
392 Call dump_archive_index on archives if set.
393 (main): Update caller.
394 (any_control_option): Give it file scope, moved out of ...
395 (parse_opt): ... here.
396
3972007-10-03 Roland McGrath <roland@redhat.com>
398
399 * unstrip.c (struct arg_info): Add `list' flag.
400 (options, parse_opt): Grok -n/--list to set it.
401 (list_module): New function.
402 (handle_implicit_modules): Call it under -n.
403
404 * elflint.c (check_note_section): New function.
405 (check_sections): Call it for SHT_NOTE.
406
407 * readelf.c (handle_notes): Use sections when available.
408
409 * elflint.c (check_note_data): New function, broken out of ...
410 (check_note): ... here. Call it and elf_getdata_rawchunk.
411
412 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
413 Use elf_getdata_rawchunk and gelf_getauxv.
414 (handle_notes_data): New function, broken out of ...
415 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
416
Roland McGrath241ac022007-10-01 18:21:46 +00004172007-10-01 Roland McGrath <roland@redhat.com>
418
Roland McGrathac0a16c2007-10-01 18:50:35 +0000419 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
420
Roland McGrath241ac022007-10-01 18:21:46 +0000421 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
422
Roland McGrathc76f0b02007-09-27 07:31:33 +00004232007-09-10 Roland McGrath <roland@redhat.com>
424
425 * readelf.c (options): Give -p optional argument, alias --string-dump.
426 (string_sections, string_sections_tail): New static variables.
427 (parse_opt): Set them when -p has an argument.
428 (print_string_section): New function, broken out of ...
429 (print_strings): ... here. Call it.
430 (dump_data_section): New function, broken out of ...
431 (dump_data): ... here. Call it.
432 (for_each_section_argument): New function, broken out of ...
433 (dump_data): ... here. Call it.
434 (dump_strings): New function.
435
4362007-08-31 Roland McGrath <roland@redhat.com>
437
438 * readelf.c (print_strings): Typo fix.
439
Roland McGrathcb6d8652007-08-23 08:10:54 +00004402007-08-23 Roland McGrath <roland@redhat.com>
441
442 * readelf.c (printf_with_wrap): Function removed.
443 (REGISTER_WRAP_COLUMN): New macro.
444 (handle_core_register): Use print_core_item instead.
445 (struct register_info): New type.
446 (compare_registers, compare_register_sets): New functions.
447 (register_bitpos, compare_sets_by_info): New functions.
448 (handle_core_registers): Use those to segregate and sort registers
449 for display.
450
451 * readelf.c (ITEM_WRAP_COLUMN): New macro.
452 (print_core_item): New function.
453 (handle_core_item): Use it instead of printf_with_wrap.
454 (compare_core_items, compare_core_item_groups): New functions.
455 (handle_core_items): Use them. Sort by group and force line breaks
456 between groups.
457
458 * readelf.c (handle_core_registers, handle_core_items): New functions,
459 broken out of ...
460 (handle_core_note): ... here. Call them.
461
4622007-08-22 Roland McGrath <roland@redhat.com>
463
464 * unstrip.c (new_shstrtab): New function, broken out of ...
465 (copy_elided_sections): ... here.
466
4672007-08-20 Roland McGrath <roland@redhat.com>
468
469 Avoid local function trampolines in nm binary.
470 * nm.c (sort_by_address): Move to a static function instead of local
471 inside show_symbols.
472 (sort_by_name_strtab): New static variable.
473 (sort_by_name): Use it. Move to a static function instead of local
474 inside show_symbols.
475 (show_symbols): Set sort_by_name_strtab.
476
4772007-08-19 Roland McGrath <roland@redhat.com>
478
479 * readelf.c (handle_auxv_note): New function.
480 (handle_notes): Call it.
481
482 * readelf.c (printf_with_wrap, convert): New functions.
483 (handle_core_item, (handle_core_register): New functions.
484 (handle_notes): Call those with details from ebl_core_note.
485
Roland McGrath099dd522007-08-13 22:58:36 +00004862007-08-12 Roland McGrath <roland@redhat.com>
487
488 * elflint.c (check_note): Accept type 0 with name "Linux".
489
490 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
491
492 * elflint.c (section_flags_string): Return "none" for 0, not "".
493
Roland McGrathd8221722007-08-11 21:18:09 +00004942007-08-11 Roland McGrath <roland@redhat.com>
495
496 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
497
Ulrich Drepperc98bcc72007-08-04 17:06:14 +00004982007-08-04 Ulrich Drepper <drepper@redhat.com>
499
500 * readelf.c (hex_dump): Use isprint to determine whether to print
501 character itself or full stop character.
502 (dump_data): No need to check endp for NULL after strtol call.
503
Roland McGrath60fc84c2007-08-03 21:59:15 +00005042007-08-03 Roland McGrath <roland@redhat.com>
505
506 * readelf.c (print_string_sections): New variable.
507 (options, parse_opt): Handle --strings/-p to set it.
508 (print_strings): New function.
509 (process_elf_file): Call it under -p.
510
511 * readelf.c (options): Add hidden aliases --segments, --sections,
512 as taken by binutils readelf.
513
5142007-08-01 Roland McGrath <roland@redhat.com>
515
516 * readelf.c (dump_data_sections, dump_data_sections_tail):
517 New variables.
518 (options, parse_opt): Handle --hex-dump/-x, set them.
519 (hex_dump): New function.
520 (dump_data): New function, call it.
521 (process_elf_file): Call it.
522
5232007-07-25 Roland McGrath <roland@redhat.com>
524
525 * addr2line.c (show_symbols): New variable.
526 (print_addrsym): New function.
527 (handle_address): Call it.
528 (options, parse_opt): Handle -S/--symbols.
529
Ulrich Drepperb0243862007-06-06 00:09:36 +00005302007-06-05 Ulrich Drepper <drepper@redhat.com>
531
532 * addr2line.c: Update for latest autoconf header.
533 * ar.c: Likewise.
534 * elfcmp.c: Likewise.
535 * elflint.c: Likewise.
536 * findtextrel.c: Likewise.
537 * ld.c: Likewise.
538 * ldgeneric.c: Likewise.
539 * nm.c: Likewise.
540 * objdump.c: Likewise.
541 * ranlib.c: Likewise.
542 * readelf.c: Likewise.
543 * size.c: Likewise.
544 * strings.c: Likewise.
545 * strip.c: Likewise.
546 * unstrip.c: Likewise.
547
Roland McGrath9aa8ef72007-05-18 08:59:43 +00005482007-05-18 Roland McGrath <roland@redhat.com>
549
550 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
551 stripped file, so as not to duplicate a section copied in both.
552
553 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
554
5552007-05-17 Roland McGrath <roland@redhat.com>
556
557 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
558
559 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
560
561 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
562 call make_directories here.
563 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
564 (handle_dwfl_module): Likewise.
565 (handle_implicit_modules): Update callers.
566 (handle_output_dir_module): Likewise. Don't do make_directories here.
567
568 * unstrip.c (get_section_name): New function, broken out of ...
569 (copy_elided_sections): here. Update callers.
570 (find_alloc_section): Broken out of ...
571 (copy_elided_sections): ... here. Update caller.
572 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
573 update STT_SECTION symbols' st_value fields as a side effect.
574 (check_symtab_section_symbols): Update caller.
575 (add_new_section_symbols): Set st_value in symbols added.
576 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
577 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
578 from .bss to .dynbss.
579 (find_alloc_sections_prelink): New function. Associate debug file
580 allocated SHT_NOBITS shdrs with stripped moved by prelink via
581 .gnu.prelink_undo information.
582 (copy_elided_sections): Call it when we couldn't find every allocated
583 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
584 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
585 (handle_file): Update callers.
586
587 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
588 named ".comment".
589
590 * elflint.c (check_sections): Fix association of segments with
591 sections when p_memsz > p_filesz.
592
5932007-04-29 Roland McGrath <roland@redhat.com>
594
595 * addr2line.c (options, main): Tweak argp group settings to fix
596 usage output.
597
5982007-04-28 Roland McGrath <roland@redhat.com>
599
600 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
601 sizes to match sections adjusted in the stripped file.
602
Roland McGrath4be15242007-04-25 03:09:33 +00006032007-04-24 Roland McGrath <roland@redhat.com>
604
605 * elfcmp.c (OPT_HASH_INEXACT): New macro.
606 (hash_inexact): New variable.
607 (options, parse_opt): Add --hash-inexact option to set it.
608 (hash_content_equivalent): New function.
609 (main): Call it for differing SHT_HASH sections under --hash-inexact.
610
6112007-04-23 Roland McGrath <roland@redhat.com>
612
613 * unstrip.c: New file.
614 * Makefile.am (bin_PROGRAMS): Add it.
615 (unstrip_LDADD): New variable.
616
617 * strip.c (options): Allow --output for -o.
618
Ulrich Drepper8b383102007-02-16 00:31:57 +00006192007-02-15 Ulrich Drepper <drepper@redhat.com>
620
621 * readelf.c: Remove unused code. Add a few consts.
622
Ulrich Drepper903c1162007-02-15 19:40:37 +00006232007-02-15 Roland McGrath <roland@redhat.com>
624
625 * readelf.c (print_debug): Fix brainos in SHDR test.
626
Roland McGrathf82a1ec2007-02-06 04:47:44 +00006272007-02-05 Roland McGrath <roland@redhat.com>
628
629 * ar.c: Include <limits.h>, since we use LONG_MAX.
630
Ulrich Drepper0fe63532007-02-05 21:05:51 +00006312007-02-05 Ulrich Drepper <drepper@redhat.com>
632
Ulrich Drepper8b383102007-02-16 00:31:57 +0000633 * ar.c: Add ugly hack to work around gcc complaining that we
Ulrich Drepper93ab56f2007-02-05 22:12:41 +0000634 ignore fchown's return value.
635 (do_oper_insert): Handle error when writing padding.
636 * ranlib.c: Add fchown complain work around.
637
Ulrich Drepper0fe63532007-02-05 21:05:51 +0000638 * arlib.c: Make symtab a global variable. Change all users.
639 * arlib2.c: Likewise.
640 * ranlib.c: Likewise.
641 * ar.c: Likewise.
642 * arlib.h: Declare it.
643
Ulrich Drepperaa915fd2007-02-05 07:25:33 +00006442007-01-11 Roland McGrath <roland@redhat.com>
645
646 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
647 SHF_MASKPROC bits separately from generic sh_flags validation.
648
Ulrich Drepperce0bdb62007-02-05 07:13:52 +00006492007-02-04 Ulrich Drepper <drepper@redhat.com>
650
651 * ar.c: New file.
652 * arlib.c: New file.
653 * arlib2.c: New file.
654 * arlib.h: New file.
655 * Makefile (noinst_LIBRARIES): Add libar.
656 (libar_a_SOURCES): Define.
657 (ar_LDADD): Define.
658 (CFLAGS_ar): Define.
659 * ranlib.c: Change to use arlib.
660
661 * elflint.c (check_symtab): Work around GNU ld bug which omits
662 sections but not symbols in those sections.
663
Ulrich Drepperb770cf92007-01-10 21:02:34 +00006642007-01-10 Ulrich Drepper <drepper@redhat.com>
665
666 * addr2line.c: Update copyright year.
667 * elfcmp.c: Likewise.
668 * elflint.c: Likewise.
669 * findtextrel.c: Likewise.
670 * ld.c: Likewise.
671 * nm.c: Likewise.
672 * objdump.c: Likewise.
673 * ranlib.c: Likewise.
674 * readelf.c: Likewise.
675 * size.c: Likewise.
676 * strings.c: Likewise.
677 * strip.c: Likewise.
678
Ulrich Drepper7c0e79f2006-12-09 21:10:19 +00006792006-12-09 Ulrich Drepper <drepper@redhat.com>
680
681 * elflint.c (compare_hash_gnu_hash): New function. Report if the
682 two hash tables have different content (module expected omission
683 of undefined symbols).
684
Roland McGrath8190db62006-12-17 23:56:51 +00006852006-10-31 Roland McGrath <roland@redhat.com>
686
687 * elflint.c (check_program_header): Don't complain about
Ulrich Drepper56bc0b82006-12-18 22:38:08 +0000688 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
Roland McGrath8190db62006-12-17 23:56:51 +0000689
6902006-09-19 Jakub Jelinek <jakub@redhat.com>
691
692 * strip.c (process_file): Disallow -f on archives.
693
6942006-10-09 Roland McGrath <roland@redhat.com>
695
696 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
697
Roland McGrathc373d852006-10-10 00:25:21 +00006982006-08-29 Roland McGrath <roland@redhat.com>
699
700 * Makefile.am (MAINTAINERCLEANFILES): New variable.
701
702 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
703 Reported by Christian Aichinger <Greek0@gmx.net>.
704
705 * elflint.c (valid_e_machine): Add EM_ALPHA.
706 Reported by Christian Aichinger <Greek0@gmx.net>.
707
Ulrich Drepper231c5902006-08-08 22:00:11 +00007082006-08-08 Ulrich Drepper <drepper@redhat.com>
709
710 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
711 Keep track of which "high DT" entries are present.
712 Check that either old or GNU-style hash table is present.
713 If GNU-style hash table is used a symbol table is mandatory.
714 Check that if any prelink entry is present all of them are.
715 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
716 table if they don't refer to functions.
717
Roland McGrath858b1892006-07-17 08:41:15 +00007182006-07-17 Roland McGrath <roland@redhat.com>
719
720 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
721 (add_version): Likewise for argument.
722 (check_versym): Cast constant to GElf_Versym for comparison.
723
Roland McGrath4ec807e2006-07-13 03:59:46 +00007242006-07-12 Roland McGrath <roland@redhat.com>
725
726 * readelf.c (handle_gnu_hash): Add casts for machines where
727 Elf32_Word != unsigned int.
728
Ulrich Drepperdcf61602006-07-12 19:59:02 +00007292006-07-12 Ulrich Drepper <drepper@redhat.com>
730
731 * elflint.c (check_sysv_hash64): Fix printf format.
732
Ulrich Dreppercc415622006-07-12 19:42:23 +00007332006-07-11 Roland McGrath <roland@redhat.com>
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000734
Ulrich Dreppercc415622006-07-12 19:42:23 +0000735 * addr2line.c (options): English fix in -f doc string.
736
737 * addr2line.c (use_comp_dir): New variable.
738 (options, parse_opt): Grok -A/--absolute to set it.
739 (handle_address): If set, prepend dwfl_line_comp_dir results to
740 relative file names.
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000741
Ulrich Drepper28ed8952006-07-07 03:43:47 +00007422006-07-06 Ulrich Drepper <drepper@redhat.com>
743
744 * elflint.c: Adjust for latest new hash table format.
745 * readelf.c: Likewise.
746
747 * elflint.c (check_versym): Ignore hidden bit when comparing version
748 numbers.
749
7502006-07-05 Ulrich Drepper <drepper@redhat.com>
751
752 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
753 discarded COMDAT symbols.
754
755 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
756 (elf_i386_create_relocations): Likewise.
757 * ld.h (struct symbol): Add local and hidden bits.
758 * ld.c (create_special_section_symbol): These synthsized symbols
759 are local and hidden.
760 * ldgeneric.c (file_process2): Check whether input file matches
761 the emulation.
762 (fillin_special_symbol): Create symbols as local and/or hidden
763 if requested.
764 (ld_generic_create_outfile): Make local copy of symbol.
765 Don't hide global, defined symbols in dynamic symbol table unless
766 requested. Synthetic symbols have no version information.
767
768 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
769 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
770
7712006-07-04 Ulrich Drepper <drepper@redhat.com>
772
773 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
774 testing.
775
7762006-07-03 Ulrich Drepper <drepper@redhat.com>
777
778 * elflint.c: Add testing of DT_GNU_HASH.
779 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
780
781 * Makefile.am: Add hacks to create dependency files for non-generic
782 linker.
783
Ulrich Drepper6ca46002006-06-12 22:40:23 +00007842006-06-12 Ulrich Drepper <drepper@redhat.com>
785
786 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
787 section if creating a DSO and no interpreter is given.
788 (ld_generic_create_outfile): Don't store reference to symbols in
789 discarded COMDAT groups. Don't create PHDR and INTERP program header
790 for DSO if no interpreter is specified.
Ulrich Drepper595d0e72006-06-12 23:25:17 +0000791 (create_verneed_data): Pretty printing.
792
Ulrich Drepper6ca46002006-06-12 22:40:23 +0000793 * ldscript.y (content): If a DSO is created don't set default
794 interpreter from linker script.
795
796 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
797 for symbols in discarded COMDAT groups.
798 (elf_i386_create_relocations): Likewise.
799 * ld.h (struct scninfo): Add unused_comdat.
800 * ldgeneric.c (add_section): Also check group signature when
801 matching COMDAT sections.
802 (add_relocatable_file): Ignore symbols in COMDAT group which are
803 discarded.
804
805 * elflint.c (check_one_reloc): For *_NONE relocs only check type
806 and symbol reference.
807
Ulrich Drepper54f33a72006-06-11 09:07:37 +00008082006-06-11 Ulrich Drepper <drepper@redhat.com>
809
Ulrich Dreppercbb51e52006-06-11 20:25:23 +0000810 * elflint.c (check_dynamic): Fix checking value of tags which are
811 offsets in the string section. Make sure DT_STRTAB points to the
812 section referenced in sh_link.
813
814 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
815
Ulrich Drepper54f33a72006-06-11 09:07:37 +0000816 * ld.c: Recognize --eh-frame-hdr option.
817 * ld.h (struct ld_state): Add eh_frame_hdr field.
818 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
819
820 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
821 SH_FLAGS_COMBINE.
822 (add_relocatable_file): Minor optimization of last change.
823 (match_section): Don't preserve SHF_GROUP flag any longer.
824
Ulrich Drepper2d880282006-06-11 00:20:43 +00008252006-06-10 Ulrich Drepper <drepper@redhat.com>
826
827 * ld.c (parse_z_option): Recognize execstack and noexecstack.
Ulrich Drepper4f0a7a82006-06-11 00:53:45 +0000828 Handle record and ignore as position dependent options.
829 (parse_z_option_2): Handle ignore and record here.
Ulrich Drepper2d880282006-06-11 00:20:43 +0000830 * ld.h (struct ld_state): Add execstack field.
831 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
832 sections.
833 (ld_generic_create_outfile): Fix program header creation in native
834 linker. Add PT_GNU_STACK program header.
835
Ulrich Dreppera688a732006-06-10 06:33:00 +00008362006-06-09 Ulrich Drepper <drepper@redhat.com>
837
838 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
839 for PLT entries if there is no local definition.
840
841 * ld.c (parse_option): Handle -z ignore like --as-needed and
842 -z record like --no-as-needed.
843 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
844 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
845 looping over DSOs. When deciding about adding DT_NEEDED entries
846 use ->as_needed instead of ignore_unused_dsos.
847
Ulrich Drepper8c56fe32006-05-31 15:50:43 +00008482006-05-31 Ulrich Drepper <drepper@redhat.com>
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000849
Ulrich Drepper8c56fe32006-05-31 15:50:43 +0000850 * ld.c: Recognize --as-needed and --no-as-needed options.
851 * ld.h (struct usedfile): Add as_needed field.
852 (struct ld_state): Likewise.
853 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
854 the list.
855 * ldscript.y (filename_id_list): Split to correctly parse all
856 combinations.
857 (mark_as_needed): Fix loop.
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000858
Ulrich Drepper697f4db2006-06-10 06:50:47 +00008592006-05-28 Ulrich Drepper <drepper@redhat.com>
860
861 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
862 and colno.
863
Ulrich Drepper2cb8e732006-05-27 21:57:27 +00008642006-05-27 Ulrich Drepper <drepper@redhat.com>
865
866 * readelf.c (handle_relocs_rela): Better notations for addon value.
Ulrich Drepper41a99082006-05-28 00:01:43 +0000867 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
Ulrich Drepper2cb8e732006-05-27 21:57:27 +0000868
Ulrich Drepper82c345d2006-04-04 22:07:54 +00008692006-04-04 Ulrich Drepper <drepper@redhat.com>
870
871 * addr2line.c: Update copyright year.
872 * elfcmp.c: Likewise.
873 * elflint.c: Likewise.
874 * findtextrel.c: Likewise.
875 * ld.c: Likewise.
876 * nm.c: Likewise.
877 * objdump.c: Likewise.
878 * ranlib.c: Likewise.
879 * readelf.c: Likewise.
880 * size.c: Likewise.
881 * strings.c: Likewise.
882 * strip.c: Likewise.
883
Roland McGrathdd7e22b2006-03-09 23:05:47 +00008842006-03-09 Roland McGrath <roland@redhat.com>
885
886 * Makefile.am (AM_LDFLAGS): New variable.
887
Roland McGrath060fa052006-03-02 07:51:50 +00008882006-03-01 Roland McGrath <roland@redhat.com>
889
890 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
891 for dwarf.h changes matching 3.0 spec.
892 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
893
Ulrich Drepper038129b2005-12-04 16:47:24 +00008942005-12-04 Ulrich Drepper <drepper@redhat.com>
895
896 * elflint.c (check_one_reloc): If relocation section is not loaded,
897 don't check whether the relocations modify read-only sections or
898 loaded and unloaded sections.
899
Ulrich Drepper607e0542005-12-04 15:51:06 +00009002005-11-28 Ulrich Drepper <drepper@redhat.com>
901
902 * elflint.c (check_one_reloc): Take additional parameters. Use
903 them to determine whether relocation is valid in this type of
904 file. DSOs and executables can contain relocation sections in
905 unloaded sections which just show the relocations the linker
906 applied. Adjust all callers.
907 (check_program_header): Check that PT_PHDR is loaded and that offset
908 matches the one in the ELF header.
909
Roland McGrath6724c902005-10-28 07:07:19 +00009102005-10-26 Roland McGrath <roland@redhat.com>
911
912 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
913
Ulrich Drepperd0449522005-09-03 07:23:52 +00009142005-09-03 Ulrich Drepper <drepper@redhat.com>
915
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000916 * strip.c (handle_elf): Unify some error messages.
917 * ld.c (main): Likewise.
918 * ldgeneric.c (open_elf): Likewise.
919 * elfcmp.c (main): Likewise.
920 * elflint.c (check_elf_header): Likewise.
921
922 * size.c (process_file): Fix typo in error message.
923
Ulrich Drepperd0449522005-09-03 07:23:52 +0000924 * readelf.c: Lots of little cleanups. Use _unlocked functions.
925
Ulrich Dreppera60501e2005-09-02 19:50:17 +00009262005-09-02 Ulrich Drepper <drepper@redhat.com>
927
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000928 * strings.c (main): Reset elfmap variable after munmap call.
Ulrich Drepper618795f2005-09-02 20:01:37 +0000929 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
Ulrich Dreppera60501e2005-09-02 19:50:17 +0000930
Ulrich Drepperfbe998a2005-08-29 16:27:10 +00009312005-08-28 Ulrich Drepper <drepper@redhat.com>
932
933 * ranlib.c: Don't define pread_retry and write_retry here.
934
935 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
936 (CLEANFILES): Add *.gcno *.gcda *.gconv.
937
938 * strings.c (process_chunk): Reorder expressions in conditional
939 (process_chunk_mb): Likewise.
940
941 * strings.c: New file.
942 * Makefile.am (bin_PROGRAMS): Add strings.
943 (strings_no_Wstring): Define.
944 (strings_LDADD): Define.
945
Roland McGrath71e15a02005-08-27 10:33:26 +00009462005-08-27 Roland McGrath <roland@redhat.com>
947
948 * addr2line.c (dwarf_diename_integrate): Function removed.
949 (print_dwarf_function): Use plain dwarf_diename.
950
Ulrich Drepperc5a06cd2005-08-24 19:50:14 +00009512005-08-24 Ulrich Drepper <drepper@redhat.com>
952
953 * elflint.c (check_versym): Versioned symbols should not have
954 local binding.
955
Ulrich Drepper5d832292005-08-15 21:36:27 +00009562005-08-15 Ulrich Drepper <drepper@redhat.com>
957
Ulrich Drepper61655e02005-08-16 04:23:02 +0000958 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
959 undefined.
960
Ulrich Drepper5d832292005-08-15 21:36:27 +0000961 * Makefile.am: Add rules to build ranlib.
962 * ranlib.c: New file.
963
Roland McGrath18e13422005-08-15 08:01:25 +00009642005-08-14 Roland McGrath <roland@redhat.com>
965
966 * elflint.c (check_sections): Use ebl_section_type_name and allow any
967 sh_type it recognizes.
968
969 * elflint.c (check_sections): Print unknown flags in hex, don't
970 truncate high bits. Print section number and name for unknown type.
971
Roland McGrathf6895042005-08-13 20:56:52 +00009722005-08-13 Roland McGrath <roland@redhat.com>
973
974 * elflint.c (check_program_header): Use ebl_segment_type_name and
975 allow any p_type it recognizes. Include p_type value in error
976 message for unknown type.
977
Ulrich Drepperc5c33a62005-08-13 17:50:47 +00009782005-08-13 Ulrich Drepper <drepper@redhat.com>
979
980 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
981 to ebl_check_special_symbol.
982 (check_sections): Pass ehdr to ebl_bss_plt_p.
983
Roland McGrath653d3762005-08-13 01:59:10 +00009842005-08-12 Roland McGrath <roland@redhat.com>
985
986 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
987 refers to the right section if it's not SHN_ABS.
988 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
989
990 * elflint.c (check_sections): Don't complain about a non-NOBITS
991 section taking no segment space, if it's sh_size is 0.
992
993 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
994 be PROGBITS or NOBITS.
995
996 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
997 standard st_value and st_size checks.
998
Roland McGrath1c83bf12005-08-11 07:03:55 +00009992005-07-28 Roland McGrath <roland@redhat.com>
Ulrich Drepperfaf4d192005-08-11 05:12:05 +00001000
Roland McGrath1c83bf12005-08-11 07:03:55 +00001001 * addr2line.c (options, parse_opt): Don't handle -e here.
1002 (executable): Variable removed.
1003 (argp_children): New static variable.
1004 (argp): Use it. Make const.
1005 (main): Fill in argp_children from dwfl_standard_argp ().
1006 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1007 (print_dwarf_function): New function. Try to figure out inline chain.
1008 (elf_getname): Function removed, libdwfl does it for us.
1009 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1010 Use dwfl_module_addrname instead of elf_getname.
1011 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1012 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1013
10142005-08-10 Ulrich Drepper <drepper@redhat.com>
1015
1016 * strip.c (parse_opt): STATE parameter is now used.
1017 Various little cleanups.
1018
1019 * readelf.c (print_debug_line_section): Correct fallout of renaming
1020 of DW_LNS_set_epilog_begin.
Ulrich Drepper6d5c3bd2005-08-11 04:37:52 +00001021
Roland McGrath8f31c2c2005-08-09 04:58:05 +000010222005-08-08 Roland McGrath <roland@redhat.com>
1023
1024 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1025 with binutils strip. Likewise -d, -S, as aliases for -g.
1026 Likewise ignore -s/--strip-all.
1027
Roland McGrath095a01b2005-08-08 03:49:35 +000010282005-08-07 Roland McGrath <roland@redhat.com>
1029
1030 * strip.c (process_file): Open read-only when using a different output
1031 file.
1032
Ulrich Drepper47be7952005-08-07 04:41:39 +000010332005-08-06 Ulrich Drepper <drepper@redhat.com>
1034
Ulrich Drepper637963b2005-08-07 05:33:07 +00001035 * elflint.c (in_nobits_scn): New function.
1036 (check_versym): Allow references for defined symbols against versions
1037 of other DSOs also for symbols in nobits sections.
1038 Move a few variables around.
1039
Ulrich Drepper47be7952005-08-07 04:41:39 +00001040 * Makefile.am (AM_CFLAGS): Avoid duplication.
1041 Link with statis libs if BUILD_STATIC.
1042
Ulrich Drepperdbace232005-08-06 01:37:23 +000010432005-08-05 Ulrich Drepper <drepper@redhat.com>
1044
1045 * elflint.c: Many, many more tests. Mostly related to symbol
1046 versioning. Those sections should now be completely checked.
1047
1048 * readelf.c (print_dynamic): Use gelf_offscn.
1049
Ulrich Drepperacb89832005-08-04 07:01:49 +000010502005-08-04 Ulrich Drepper <drepper@redhat.com>
1051
1052 * elflint.c: Add lots more tests: more extension symbol table sanity,
1053 versioning section tests, hash table tests. General cleanup.
1054
Ulrich Drepperc911c9e2005-08-02 16:07:42 +000010552005-08-02 Ulrich Drepper <drepper@redhat.com>
1056
Ulrich Drepper8a687742005-08-03 02:24:12 +00001057 * objdump.c: New file.
1058 * Makefile.am (bin_PROGRAMS): Add objdump.
1059 (objdump_LDADD): Define.
1060
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001061 * elflint.c (check_reloc_shdr): New function split out from check_rela
1062 and check_rel.
1063 (check_one_reloc): New function. Likewise.
1064 (check_rela): Use check_reloc_shdr and check_one_reloc.
1065 (check_rel): Likewise.
Ulrich Drepper41de4882005-08-03 00:02:56 +00001066 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
1067 section.
1068 Add checks that relocations against read-only segments are flagged,
1069 that the text relocation flag is not set unnecessarily, and that
1070 relocations in one section are either against loaded or not-loaded
1071 segments.
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001072
Ulrich Drepper8533dcf2005-08-01 07:18:47 +000010732005-08-01 Ulrich Drepper <drepper@redhat.com>
1074
1075 * elfcmp.c (main): Ignore section count and section name string table
1076 section index.
1077
Roland McGrathf9ece8a2005-07-28 07:03:04 +000010782005-07-27 Roland McGrath <roland@redhat.com>
1079
1080 * elfcmp.c: Include <locale.h>.
1081
Ulrich Drepper7d48d6a2005-07-27 10:13:23 +000010822005-07-27 Ulrich Drepper <drepper@redhat.com>
1083
1084 * elfcmp.c: Print name and index of differing section.
1085
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000010862005-07-24 Ulrich Drepper <drepper@redhat.com>
1087
1088 * elfcmp.c: Implement comparing gaps between sections.
1089
10902005-07-23 Ulrich Drepper <drepper@redhat.com>
1091
1092 * elflint.c: Include libeblP.h instead of libebl.h.
1093 * nm.c: Likewise.
1094 * readelf.c: Likewise.
1095 * elfcmp.c: Likewise.
1096
1097 * elfcmp.c (main): Compare individual ELF header fields, excluding
1098 e_shoff instead of the whole struct at once.
1099 Use ebl_section_strip_p instead of SECTION_STRIP_P.
1100 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
1101
11022005-07-22 Ulrich Drepper <drepper@redhat.com>
1103
1104 * elfcmp.c (main): Take empty section into account when comparing
1105 section content.
1106
1107 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
1108 using it.
1109
11102005-07-21 Ulrich Drepper <drepper@redhat.com>
1111
1112 * elfcmp.c: New file.
1113 * Makefile.am (bin_PROGRAMS): Add elfcmp.
1114 (elfcmp_LDADD): Define.
1115
1116 * elflint.c (check_rela): Check that copy relocations only reference
1117 object symbols or symbols with unknown type.
1118 (check_rel): Likewise.
1119
11202005-06-08 Roland McGrath <roland@redhat.com>
1121
1122 * readelf.c (print_ops): Add consts.
1123
11242005-05-31 Roland McGrath <roland@redhat.com>
1125
1126 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
1127 abbreviations. Print a header line before each CU section.
1128
1129 * readelf.c (print_debug_loc_section): Fix indentation for larger
1130 address size.
1131
11322005-05-30 Roland McGrath <roland@redhat.com>
1133
1134 * readelf.c (print_debug_line_section): Print section offset of each
1135 CU's table, so they are easy to find from seeing the stmt_list value.
1136
1137 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
1138 (attr_callback): Grok DW_AT_ranges and print offset in hex.
1139
1140 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
1141 (print_debug_ranges_section, print_debug_loc_section): Likewise.
1142
1143 * readelf.c (print_ops): Take different args for indentation control.
1144 (attr_callback): Caller updated.
1145 Grok several more block-form attributes as being location expressions.
1146 For those same attributes with udata forms, format output differently
1147 for location list offset.
1148 (print_debug_loc_section): Implement it for real.
1149
1150 * readelf.c (options): Mention ranges for --debug-dump.
1151 (enum section_e): Add section_ranges.
1152 (parse_opt): Grok "ranges" for -w/--debug-dump.
1153 (print_debug_ranges_section): New function.
1154 (print_debug): Handle .debug_ranges section.
1155
11562005-05-30 Ulrich Drepper <drepper@redhat.com>
1157
1158 * readelf.c (handle_notes): At least x86-64 need not have the note
1159 section values aligned to 8 bytes.
1160
11612005-05-18 Ulrich Drepper <drepper@redhat.com>
1162
1163 * readelf.c (dwarf_tag_string): Add new tags.
1164
11652005-05-08 Roland McGrath <roland@redhat.com>
1166
1167 * strip.c (handle_elf): Don't translate hash and versym data formats,
1168 elf_getdata already did it for us.
1169
11702005-05-07 Ulrich Drepper <drepper@redhat.com>
1171
1172 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
1173 (addr2line_LDADD): Likewise.
1174
11752005-05-03 Roland McGrath <roland@redhat.com>
1176
1177 * strip.c (handle_elf): Apply symbol table fixups to discarded
1178 relocation sections when they are being saved in the debug file.
1179
1180 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
1181 and gelf_xlatetof, not the native byte order.
1182
1183 * strip.c (parse_opt): Give error if -f or -o is repeated.
1184 (main): Exit if argp_parse returns nonzero.
1185
1186 * strip.c (debug_fname_embed): New variable.
1187 (options, parse_opt): New option -F to set it.
1188
11892005-05-07 Ulrich Drepper <drepper@redhat.com>
1190
1191 * readelf.c (parse_opt): Make any_control_option variable
1192 local. Simplify some tests.
1193
11942005-05-03 Roland McGrath <roland@redhat.com>
1195
1196 * strip.c (crc32_file): Function removed (now in ../lib).
1197
11982005-05-03 Roland McGrath <roland@redhat.com>
1199
1200 * elflint.c (is_debuginfo): New variable.
1201 (options, parse_opt): New option --debuginfo/-d to set it.
1202 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
1203 (check_note): If is_debuginfo, don't try to get note contents.
1204
12052005-04-24 Ulrich Drepper <drepper@redhat.com>
1206
1207 * readelf.c (print_debug_abbrev_section): Don't print error when end of
1208 section reached.
1209
12102005-04-14 Ulrich Drepper <drepper@redhat.com>
1211
1212 * readelf.c (dwarf_encoding_string): New function.
1213 (dwarf_inline_string): New function.
1214 (dwarf_access_string): New function.
1215 (dwarf_visibility_string): New function.
1216 (dwarf_virtuality_string): New function.
1217 (dwarf_identifier_case_string): New function.
1218 (dwarf_calling_convention_string): New function.
1219 (dwarf_ordering_string): New function.
1220 (dwarf_discr_list_string): New function.
1221 (attr_callback): Decode man more attribute values.
1222
12232005-04-01 Ulrich Drepper <drepper@redhat.com>
1224
1225 * addr2line.c: Finish implementation of -f option.
1226
12272005-03-29 Ulrich Drepper <drepper@redhat.com>
1228
1229 * addr2line.c: New file.
1230 * Makefile.am (bin_PROGRAMS): Add addr2line.
1231 Define addr2line_LDADD.
1232
1233 * findtextrel.c: Use new dwarf_addrdie function.
1234
1235 * findtextrel.c: Fix usage message and re-add accidentally removed
1236 line.
1237
12382005-03-28 Ulrich Drepper <drepper@redhat.com>
1239
1240 * findtextrel.c: New file.
1241 * Makefile: Add rules to build findtextrel.
1242
12432005-02-15 Ulrich Drepper <drepper@redhat.com>
1244
1245 * ldlex.l: Provide ECHO definition to avoid warning.
1246
1247 * elflint.c (check_program_header): Fix typo in RELRO test.
1248
1249 * Makefile.am (AM_CFLAGS): Add more warning options.
1250 * elflint.c: Fix warnings introduced by the new warning options.
1251 * i386_ld.c: Likewise.
1252 * ld.c: Likewise.
1253 * ld.h: Likewise.
1254 * ldgeneric.c: Likewise.
1255 * nm.c: Likewise.
1256 * readelf.c: Likewise.
1257 * sectionhash.c: Likewise.
1258 * size.c: Likewise.
1259 * string.c: Likewise.
1260
12612005-02-05 Ulrich Drepper <drepper@redhat.com>
1262
1263 * Makefile.am: Check for text relocations in constructed DSOs.
1264
1265 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
1266 with -lmudflap.
1267
1268 * ldscript.y: Add as_needed handling.
1269 * ldlex.l: Recognize AS_NEEDED token.
1270 * ld.h (struct filename_list): Add as_needed flag.
1271
12722005-02-04 Ulrich Drepper <drepper@redhat.com>
1273
1274 * elflint.c (check_symtab): Correctly determine size of GOT section.
1275
12762005-01-19 Ulrich Drepper <drepper@redhat.com>
1277
1278 * ld.c: Remove unnecessary more_help function. Print bug report
1279 address using argp.
1280 * strip.c: Likewise.
1281 * size.c: Likewise.
1282 * nm.c: Likewise.
1283 * readelf.c: Likewise.
1284 * elflint.c: Likewise.
1285
1286 * elflint.c (main): Don't check for parameter problems here.
1287 (parse_opt): Do it here, where we get informed about some of them
1288 anyway.
1289
1290 * readelf.c (main): Don't check for parameter problems here.
1291 (parse_opt): Do it here, where we get informed about some of them
1292 anyway.
1293
12942005-01-11 Ulrich Drepper <drepper@redhat.com>
1295
1296 * strip.c: Update copyright year.
1297 * readelf.c: Likewise.
1298 * size.c: Likewise.
1299 * nm.c: Likewise.
1300 * ld.c: Likewise.
1301 * elflint.c: Likewise.
1302
1303 * elflint.c (check_symtab): Don't warn about wrong size for
1304 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
1305
13062004-10-05 Ulrich Drepper <drepper@redhat.com>
1307
1308 * readelf.c (print_phdr): In section mapping, also indicate
1309 sections in read-only segments.
1310
13112004-09-25 Ulrich Drepper <drepper@redhat.com>
1312
1313 * readelf.c: Make compile with gcc 4.0.
1314 * strip.c: Likewise.
1315
13162004-08-16 Ulrich Drepper <drepper@redhat.com>
1317
1318 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
1319 allocate to work around gcc 3.4 bug.
1320
13212004-01-25 Ulrich Drepper <drepper@redhat.com>
1322
1323 * ldlex.l (invalid_char): Better error message.
1324
13252004-01-23 Ulrich Drepper <drepper@redhat.com>
1326
1327 * readelf.c: Print SHT_GNU_LIBLIST sections.
1328
1329 * none_ld.c: New file.
1330
13312004-01-21 Ulrich Drepper <drepper@redhat.com>
1332
1333 * Makefile.am: Enable building of machine specific linker.
1334
13352004-01-20 Ulrich Drepper <drepper@redhat.com>
1336
1337 * Makefile.am: Support building with mudflap.
1338
1339 * i386_ld.c: Fix warnings gcc 3.4 spits out.
1340 * ldgeneric.c: Likewise.
1341 * ldscript.y: Likewise.
1342 * readelf.c: Likewise.
1343 * strip.c: Likewise.
1344
1345 * readelf.c (print_debug_line_section): Determine address size
1346 correctly.
1347
13482004-01-19 Ulrich Drepper <drepper@redhat.com>
1349
1350 * readelf.c (print_phdr): Show which sections are covered by the
1351 PT_GNU_RELRO entry.
1352
1353 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
1354
1355 * readelf.c (print_debug_macinfo_section): Implement.
1356
13572004-01-18 Ulrich Drepper <drepper@redhat.com>
1358
1359 * readelf.c (print_debug_line_section): Implement.
1360
13612004-01-17 Ulrich Drepper <drepper@redhat.com>
1362
1363 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
1364 * src/ld.c: Likewise.
1365 * src/nm.c: Likewise.
1366 * src/readelf.c: Likewise.
1367 * src/size.c: Likewise.
1368 * src/strip.c: Likewise.
1369
1370 * strip.c: Add a few more unlikely. Reduce scope of some variables.
1371
1372 * Makefile.am: Support building with mudflap.
1373
13742004-01-16 Ulrich Drepper <drepper@redhat.com>
1375
1376 * readelf.c (print_debug_info_section): Free dies memory.
1377
1378 * readelf.c: Print .debug_info section content.
1379
13802004-01-13 Ulrich Drepper <drepper@redhat.com>
1381
1382 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
1383
13842004-01-12 Ulrich Drepper <drepper@redhat.com>
1385
1386 * readelf.c (print_debug_aranges): Implement using libdw.
1387
13882004-01-11 Ulrich Drepper <drepper@redhat.com>
1389
1390 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
1391
1392 * readelf.c: Use libdw instead of libdwarf. Not all of the old
1393 behavior is available yet.
1394 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
1395
13962004-01-09 Ulrich Drepper <drepper@redhat.com>
1397
1398 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
1399
1400 * nm.c: Implement getting information about local variables.
1401
14022004-01-07 Ulrich Drepper <drepper@redhat.com>
1403
1404 * nm.c: Read also debug information for local symbols.
1405
14062004-01-05 Ulrich Drepper <drepper@redhat.com>
1407
1408 * nm.c: Shuffle dwarf handling code around so the maximum column
1409 width can be computed ahead of printing. Avoid collection symbols
1410 which are not printed anyway.
1411
1412 * nm.c: Rewrite dwarf handling to use libdw.
1413 * Makefile.am (AM_CFLAGS): Add -std parameter.
1414 (INCLUDES): Find header in libdw subdir.
1415 (nm_LDADD): Replace libdwarf with libdw.
1416
1417 * elflint.c: Update copyright year.
1418 * readelf.c: Likewise.
1419 * size.c: Likewise.
1420 * strip.c: Likewise.
1421 * nm.c: Likewise.
1422
14232003-12-31 Ulrich Drepper <drepper@redhat.com>
1424
1425 * strip.c (process_file): Close file before returning.
1426
14272003-11-19 Ulrich Drepper <drepper@redhat.com>
1428
1429 * readelf.c (handle_dynamic): Make column for tag name wider.
1430
14312003-09-29 Ulrich Drepper <drepper@redhat.com>
1432
1433 * readelf.c (handle_dynamic): Always terminate tag name with a space.
1434
14352003-09-25 Ulrich Drepper <drepper@redhat.com>
1436
1437 * strip.c (process_file): Don't mmap the input file, we modify the
1438 data structures and don't want the change end up on disk.
1439
14402003-09-23 Jakub Jelinek <jakub@redhat.com>
1441
1442 * unaligned.h (union u_2ubyte_unaligned,
1443 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
1444 packed attribute.
1445 (add_2ubyte_unaligned, add_4ubyte_unaligned,
1446 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
1447 Read/store value through _ptr->u instead of *_ptr.
1448
14492003-09-22 Ulrich Drepper <drepper@redhat.com>
1450
1451 * size.c (show_sysv): Change type of maxlen to int.
1452
1453 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
1454 buckets.
1455
1456 * i386_ld.c: Many many fixes and extensions.
1457 * ld.c: Likewise.
1458 * ldgeneric.c: Likewise.
1459
14602003-08-16 Ulrich Drepper <drepper@redhat.com>
1461
1462 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
1463 the reference is from another DSO.
1464
14652003-08-15 Ulrich Drepper <drepper@redhat.com>
1466
1467 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
1468 point is found when creating a DSO.
1469
14702003-08-14 Ulrich Drepper <drepper@redhat.com>
1471
1472 * ld.c (main): Always call FLAG_UNRESOLVED.
1473 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
1474 undefined symbols if not creating DSO or ld_state.nodefs is not set.
1475
14762003-08-13 Ulrich Drepper <drepper@redhat.com>
1477
1478 * Makefile.in: Depend on libebl.a, not libebl.so.
1479
1480 * ld.c (main): Mark stream for linker script as locked by caller.
1481 (read_version_script): Likewise.
1482 * ldlex.c: Define fread and fwrite to _unlocked variant.
1483
1484 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
1485 target_bswap_32.
1486 * unaligned.h: Define target_bswap_16, target_bswap_32, and
1487 target_bswap_64.
1488 (store_2ubyte_unaligned, store_4ubyte_unaligned,
1489 store_8ubyte_unaligned): Define using new macros.
1490
14912003-08-12 Ulrich Drepper <drepper@redhat.com>
1492
1493 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
1494 possibly unaligned memory. Support use of big endian machines.
1495
14962003-08-11 Ulrich Drepper <drepper@redhat.com>
1497
1498 * Moved to CVS archive.