blob: fb17835fd8588a9da6953b7636d12045ed30ddf4 [file] [log] [blame]
Roland McGratha845f682008-12-03 03:41:58 +000012008-12-02 Roland McGrath <roland@redhat.com>
2
3 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
4 nonzero OFFSET argument to dwfl_getmodules.
5
Roland McGrath1d8bb252008-08-07 08:39:41 +000062008-08-07 Roland McGrath <roland@redhat.com>
7
8 * addr2line.c (main): Pass string to handle_address.
9 (see_one_module): New function, subroutine of handle_address.
10 (find_symbol): Likewise.
11 (handle_address): Take string argument rather than address.
12 Convert plain number, or handle strings like "(section)+offset"
13 or "symbol+offset".
14
152008-08-01 Roland McGrath <roland@redhat.com>
16
17 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
18 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
19
20 * readelf.c (convert): Take new argument SIZE.
21 (handle_core_register, handle_core_item): Update callers.
22 (handle_core_item): Take new arg REPEATED_SIZE.
23 (handle_core_items): Special case for a singleton item,
24 let handle_core_item handle repeats if it wants to.
25
26 * readelf.c (handle_core_items): Give abridged output
27 for identical groups repeated more than twice.
28
292008-07-04 Roland McGrath <roland@redhat.com>
30
31 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
32
Roland McGrath521c47d2008-04-11 07:01:58 +0000332008-04-10 Roland McGrath <roland@redhat.com>
34
35 * strip.c (handle_elf): Don't keep sections that kept symbol tables
36 refer to. Instead, just be sure to preserve the original symbol
37 table in the debug file so those symbols go with their sections and
38 can be elided from the stripped version of the symbol table.
39
40 * strip.c (handle_elf): When a discarded section kept in the debug
41 file refers to a nondiscard section via sh_link/sh_info, preserve
42 that nondiscarded section unmodified in the debug file as well.
43 Skip adjustment of discarded sections symbol table references when
44 that symbol table is copied in this way.
45
46 * elflint.c (check_symtab): Don't crash from missing symbol names
47 after diagnosing bogus strtab.
48
49 * strip.c (handle_elf): Cosmetic cleanup in special section contents
50 adjustment for symtab changes.
51
Roland McGrath13b69602008-04-01 02:30:05 +0000522008-03-31 Roland McGrath <roland@redhat.com>
53
54 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
55 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
56 excuse a special section.
57
582008-03-27 Roland McGrath <roland@redhat.com>
59
60 * elflint.c (check_sections): Check that executability and writability
61 of sections is reflected in segment p_flags.
62
Roland McGrathd11f9cb2008-03-26 20:51:59 +0000632008-03-26 Roland McGrath <roland@redhat.com>
64
65 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
66 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
67 is valid in RELRO.
68
Roland McGrath47c5c352008-02-29 10:17:16 +0000692008-02-29 Roland McGrath <roland@redhat.com>
70
71 * readelf.c (print_attributes): Add a cast.
72 * elflint.c (check_attributes): Likewise.
73
74 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
75 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
76 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
77
Ulrich Drepper834de6f2008-02-23 06:50:01 +0000782008-02-03 Ulrich Drepper <drepper@redhat.com>
79
80 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
81 when linked into executable.
82 (elf_i386_create_relocations): Likewise.
83
Roland McGrath059c83e2008-02-21 06:19:39 +0000842008-02-20 Roland McGrath <roland@redhat.com>
85
86 * readelf.c (print_attributes): New function.
87 (process_elf_file): Call it under -A.
88
89 * elflint.c (check_attributes): Implement it for real.
90
912008-02-19 Roland McGrath <roland@redhat.com>
92
93 * elflint.c (special_sections): Handle .gnu.attributes section.
94 (check_sections): Likewise.
95 (check_attributes): New function.
96
972008-02-10 Roland McGrath <roland@redhat.com>
98
99 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
100 sections and ET_REL files.
101
Ulrich Drepper712d78e2008-02-02 10:01:53 +00001022008-02-02 Ulrich Drepper <drepper@redhat.com>
103
104 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
105 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
106 and R_386_TLS_LE.
107 (elf_i386_create_relocations): Likewise.
108 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
109 elements.
110 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
111 (ld_generic_create_outfile): Add PT_TLS entry to program header.
112 Fix generation of PT_GNU_STACK entry.
113
Ulrich Drepperc54785a2008-02-01 18:05:21 +00001142008-02-01 Ulrich Drepper <drepper@redhat.com>
115
Ulrich Drepper7cd1bf72008-02-01 23:52:59 +0000116 * ld.c (replace_args): Prevent loop over replacements if the parameter
117 is only two characters long.
118
Ulrich Drepperc54785a2008-02-01 18:05:21 +0000119 * ld.c: Recognize sha1 argument for --build-id parameter.
120 * ldgeneric.c (create_build_id_section): Handle sha1.
121 (compute_hash_sum): New function. Broken out of compute_build_id.
122 Take hash function and context as parameters.
123 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
124 implementation.
125
Ulrich Drepper89759c72008-01-31 19:44:12 +00001262008-01-31 Ulrich Drepper <drepper@redhat.com>
127
128 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
129 * ld.c: Recognize --build-id command line parameter.
130 * ld.h: Define scn_dot_note_gnu_build_id.
131 (struct ld_state): Add build_id and buildidscnidx elements.
132 * ldgeneric.c: Implement --build-id command line parameter.
133 * ldlex.l (ID): Recognize - as valid character after the first one.
134
Ulrich Drepper5530ec52008-01-29 10:42:07 +00001352008-01-29 Ulrich Drepper <drepper@redhat.com>
136
Ulrich Drepperb61c4cc2008-01-30 07:16:28 +0000137 * ld.c (replace_args): New function.
138 (main): Use it to rewrite old-style parameters.
139
Ulrich Dreppered9b6cb2008-01-30 06:33:33 +0000140 * elf32-i386.script: Add .gnu.hash section.
141 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
142 (fillin_special_symbol): Initialize st_size.
143 (sortfct_hashval): New function.
144 (create_gnu_hash): New function.
145 (create_hash): New function.
146 (ld_generic_create_outfile): Use the new functions to create the
147 hash tables.
148
Ulrich Drepper5530ec52008-01-29 10:42:07 +0000149 * elflint.c (check_gnu_hash): Fix index value printed in error message.
150
Ulrich Drepper0e864dd2008-01-25 00:18:42 +00001512008-01-24 Ulrich Drepper <drepper@redhat.com>
152
153 * elflint.c (check_group): Check that signature symbol for section
154 group is not an empty string.
155 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
156 section. Start implementation of --hash-style.
157 * i386_ld.c: Likewise.
158 * ld.c: Recognize --hash-style.
159 * ld.h (struct scninfo): Add comdat_group.
160 Add additional parameter to finalize_plt callback.
161
Ulrich Drepper5449a6b2008-01-22 15:49:39 +00001622008-01-22 Ulrich Drepper <drepper@redhat.com>
163
164 * ld.h (struct callbacks): Add initialize_gotplt.
165 (struct scnhead): Add scn_dot_gotplt.
166 (struct ld_state): Add gotpltscnidx.
167 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
168 (elf_i386_initialize_pltrel): Likewise.
169 (elf_i386_initialize_got): There is now a separate .got.plt, so
170 don't do the PLT-related work here. Initialize d_type.
171 (elf_i386_initialize_gotplt): New function.
172 (elf_i386_plt0): Use ud2a after indirect jump.
173 (elf_i386_pic_plt0_entry): Likewise.
174 (elf_i386_finalize_plt): Reference now .got.plt.
175 (elf_i386_count_relocations): For GOT entries which need no relocation
176 don't bump nrel_got.
177 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
178 handling for split .got/.got.plt.
179 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
180 * elf32-i386.script: Sort sections for security. There are no .got
181 input sections. Add .got.plt.
182 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
183 (ld_generic_create_outfile): Initialize .got.plt section.
184 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
185
Ulrich Drepperd9488292008-01-20 16:43:15 +00001862008-01-19 Ulrich Drepper <drepper@redhat.com>
187
188 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
189 symbols are not carried over into statically linked output files.
190 Add dummy entries for more TLS relocations.
191
192 * ld.c (options): Add long names for -( and -).
193
194 * ldgeneric.c (check_definition): For newly found definitions don't
195 mark section as used if symbol is absolute.
196 (extract_from_archive): Only assign archive sequence number the first
197 time the archive is handled. Update ld_state.last_archive_used
198 if any symbol was used. Remove nround variable.
199 (file_process2): When using symbol from an archive, update
200 ld_state.group_start_archive, ld_state.archives, and
201 ld_state.tailarchives.
202 (ld_generic_file_process): If group is not handled anymore, after
203 freeing ELF handles for the archives, clear ld_state.archives and
204 *nextp. Fix wrong logic in recognizing first iteration of group
205 loop. When clearing flags, also clear ld_state.group_start_archive.
206
Ulrich Drepper5eee1222008-01-11 10:12:18 +00002072008-01-11 Ulrich Drepper <drepper@redhat.com>
208
209 * objdump.c (show_disasm): Adjust disassembler format string for
210 removal of %e.
211
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00002122008-01-04 Roland McGrath <roland@redhat.com>
213
Roland McGrath059c83e2008-02-21 06:19:39 +0000214 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
215 a size greater than the items cover means multiple sets of items.
216 (handle_core_note): Update caller.
217
2182008-01-04 Roland McGrath <roland@redhat.com>
219
Ulrich Dreppere219f1c2008-01-09 05:49:49 +0000220 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
221
2222008-01-03 Roland McGrath <roland@redhat.com>
223
224 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
225
226 * elflint.c (check_dynamic): Remove duplicate initializer.
227
Ulrich Drepperad024af2008-01-02 17:42:52 +00002282008-01-02 Ulrich Drepper <drepper@redhat.com>
229
230 * addr2line.c: Update copyright year.
231 * ar.c: Likewise.
232 * elfcmp.c: Likewise.
233 * elflint.c: Likewise.
234 * findtextrel.c: Likewise.
235 * ld.c: Likewise.
236 * nm.c: Likewise.
237 * objdump.c: Likewise.
238 * ranlib.c: Likewise.
239 * readelf.c: Likewise.
240 * size.c: Likewise.
241 * strings.c: Likewise.
242 * strip.c: Likewise.
243 * unstrip.c: Likewise.
244
Ulrich Drepper3cbdd382008-01-02 17:44:39 +00002452007-12-30 Ulrich Drepper <drepper@redhat.com>
246
247 * objdump (show_disasm): Use %e after third parameter.
248
2492007-12-21 Ulrich Drepper <drepper@redhat.com>
250
251 * strip.c: Fix wrong parenthesis in a few branch predictions.
252 * strings.c: Likewise.
253
2542007-12-20 Ulrich Drepper <drepper@redhat.com>
255
256 * Makefile.am (DEFS): Add DEBUGPRED.
257 * addr2line.c: Include debugpred.h.
258 * ar.c: Likewise.
259 * elfcmp.c: Likewise.
260 * elflint.c: Likewise.
261 * findtextrel.c: Likewise.
262 * nm.c: Likewise.
263 * objdump.c: Likewise.
264 * ranlib.c: Likewise.
265 * readelf.c: Likewise.
266 * size.c: Likewise.
267 * strings.c: Likewise.
268 * strip.c: Likewise.
269 * unstrip.c: Likewise.
270 * debugpred.h: New file.
271
272 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
273 (handle_relocs_rela): Likewise.
274
275 * readelf.c: Add lots of likely/unlikely.
276
277 * elflint.c: Minor cleanups.
278
Roland McGrath1a2e8f42007-12-15 23:39:34 +00002792007-11-19 Roland McGrath <roland@redhat.com>
280
281 * readelf.c (print_ops): Handle all bad op codes gracefully.
282 Print their numbers instead of just ???.
283
Roland McGrath07a696e2007-11-09 22:44:26 +00002842007-11-09 Roland McGrath <roland@redhat.com>
285
286 * readelf.c (attr_callback): Handle DW_AT_data_location.
Roland McGrath1a2e8f42007-12-15 23:39:34 +0000287 Handle block forms to mean a DWARF expression for DW_AT_allocated,
288 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
289 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
290 DW_AT_upper_bound.
Roland McGrath07a696e2007-11-09 22:44:26 +0000291
Roland McGrathe4c22ea2007-10-23 13:07:39 +00002922007-10-20 Roland McGrath <roland@redhat.com>
293
294 * unstrip.c (options): Update -R description.
295 (struct symbol): Put symbol details a union with a size_t pointer
296 `duplicate'.
297 (compare_symbols_output): Use null ->name as marker for discard
298 symbols, not zero *->map.
299 (copy_elided_sections): Record forwarding pointers for discarded
300 duplicates and fill SYMNDX_MAP elements through them.
301
302 * readelf.c (process_file): Set offline_next_address to 0 at start.
303 (struct process_dwflmod_args): New type.
304 (process_dwflmod): Take args in it, pass fd to process_elf_file.
305 (process_file): Update caller; dup FD for passing to libdwfl.
306 (process_elf_file): Take new arg FD. For ET_REL file when
307 displaying data affected by libdwfl relocation, open a new Elf handle.
308
3092007-10-17 Roland McGrath <roland@redhat.com>
310
311 * readelf.c (print_debug_line_section): For invalid data inside a
312 unit with plausible length, keep printing at the next unit boundary.
313
314 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
315
3162007-10-16 Roland McGrath <roland@redhat.com>
317
318 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
319
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00003202007-10-15 Roland McGrath <roland@redhat.com>
321
322 * make-debug-archive.in: New file.
323 * Makefile.am (EXTRA_DIST): Add it.
324 (make-debug-archive): New target.
325 (bin_SCRIPTS, CLEANFILES): Add it.
326
3272007-10-10 Roland McGrath <roland@redhat.com>
328
329 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
330 Use it to check MERGE|STRINGS for .debug_str.
331 (check_sections): Handle exact_or_gnuld.
332
3332007-10-08 Roland McGrath <roland@redhat.com>
334
335 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
336 64-bit struct timeval with 32-bit tv_usec.
337
3382007-10-07 Roland McGrath <roland@redhat.com>
339
340 * readelf.c (check_archive_index): New function.
341 (process_file): Call it. Change signature to take only fd and name.
342 Use libdwfl to open the file, then iterate on its modules (multiple
343 for an archive) to print file name and call process_elf_file.
344 (main): Update caller. Let process_file do elf_begin.
345 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
346 (process_elf_file): Take only Dwfl_Module * argument.
347 Don't print the file name here.
348 (print_debug_*_section): Take Dwfl_Module * argument.
349 (print_debug): Likewise. Update caller.
350 (format_dwarf_addr): New function.
351 (print_debug_ranges_section): Use it.
352 (attr_callback): Likewise.
353 (print_debug_line_section, print_debug_loc_section): Likewise.
354
355 * readelf.c (print_debug_ranges_section): Translate all strings.
356 (print_debug_loc_section): Likewise.
357
358 * unstrip.c (copy_elided_sections): Initialize SEC.
359
360 * ar.c (do_oper_insert): Put trailing / on short names.
361
362 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
363
364 * arlib2.c (arlib_add_long_name): Adjust for header size.
365
366 * arlib.c (arlib_finalize): Pad long name table to keep size even.
367
368 * ar.c (do_oper_insert): Use write_retry for padding write.
369
370 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
371 Unconditionally set FOUND[CNT]->elf when setting ->mem.
372 (remember_long_name): New function.
373 (do_oper_insert): Call it. Correctly use length of basename,
374 not original name. Don't store long name twice for new member.
375
3762007-10-06 Roland McGrath <roland@redhat.com>
377
378 * elflint.c (check_note): Skip empty segment.
379 (check_note_section): Skip empty section.
380
381 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
382 (handle_output_dir_module, handle_implicit_modules): Pass it down.
383 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
384 (compare_alloc_sections): Take new arg REL, ignore address if true.
385 (compare_sections): Likewise, pass it down.
386 (compare_sections_rel, compare_sections_nonrel): New functions.
387 (find_alloc_sections_prelink, copy_elided_sections): Use them
388 instead of compare_sections.
389 (sections_match): New function, broken out of ...
390 (find_alloc_section): ... here.
391 (copy_elided_sections): Reorganize section match-up logic.
392 Use sections_match for SHF_ALLOC in ET_REL.
393 For ET_REL, let the nonzero sh_addr from the debug file dominate.
394
395 * unstrip.c (add_new_section_symbols): Take new arg REL.
396 When true, do not update section symbol values.
397 (collect_symbols): Likewise. Update section symbols with address
398 of chosen output section, not original section.
399 (check_symtab_section_symbols, copy_elided_sections): Update callers.
400
401 * unstrip.c (compare_alloc_sections): At the same address, preserve
402 original section order.
403
404 * elflint.c (special_sections): Don't require MERGE|STRINGS for
405 .debug_str, it didn't always have them with older tools.
406
407 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
408
4092007-10-05 Roland McGrath <roland@redhat.com>
410
411 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
412 ET_REL file.
413
414 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
415 SHN_UNDEF as "bad section". Use shndx value in messages.
416
417 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
418 for ".debug" so it matches as a prefix.
419 (IS_KNOWN_SPECIAL): New macro.
420 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
421 type even under -d, for a .debug* or .shstrtab section.
422
423 * readelf.c (print_ops): Use hex for address operand.
424
4252007-10-04 Roland McGrath <roland@redhat.com>
426
427 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
428 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
429 sections mapped to SHN_UNDEF.
430
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00004312007-10-04 Ulrich Drepper <drepper@redhat.com>
432
433 * readelf.c (dump_archive_index): Avoid warning about uninitialized
434 variable with older glibc versions.
435 Add some branch prediction.
436
Roland McGrath59ea7f32007-10-04 08:50:09 +00004372007-10-04 Roland McGrath <roland@redhat.com>
438
439 * readelf.c (print_archive_index): New variable.
440 (options, parse_opt): Accept -c/--archive-index to set it.
441 (dump_archive_index): New function.
442 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
443 Call dump_archive_index on archives if set.
444 (main): Update caller.
445 (any_control_option): Give it file scope, moved out of ...
446 (parse_opt): ... here.
447
4482007-10-03 Roland McGrath <roland@redhat.com>
449
450 * unstrip.c (struct arg_info): Add `list' flag.
451 (options, parse_opt): Grok -n/--list to set it.
452 (list_module): New function.
453 (handle_implicit_modules): Call it under -n.
454
455 * elflint.c (check_note_section): New function.
456 (check_sections): Call it for SHT_NOTE.
457
458 * readelf.c (handle_notes): Use sections when available.
459
460 * elflint.c (check_note_data): New function, broken out of ...
461 (check_note): ... here. Call it and elf_getdata_rawchunk.
462
463 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
464 Use elf_getdata_rawchunk and gelf_getauxv.
465 (handle_notes_data): New function, broken out of ...
466 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
467
Roland McGrath241ac022007-10-01 18:21:46 +00004682007-10-01 Roland McGrath <roland@redhat.com>
469
Roland McGrathac0a16c2007-10-01 18:50:35 +0000470 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
471
Roland McGrath241ac022007-10-01 18:21:46 +0000472 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
473
Roland McGrathc76f0b02007-09-27 07:31:33 +00004742007-09-10 Roland McGrath <roland@redhat.com>
475
476 * readelf.c (options): Give -p optional argument, alias --string-dump.
477 (string_sections, string_sections_tail): New static variables.
478 (parse_opt): Set them when -p has an argument.
479 (print_string_section): New function, broken out of ...
480 (print_strings): ... here. Call it.
481 (dump_data_section): New function, broken out of ...
482 (dump_data): ... here. Call it.
483 (for_each_section_argument): New function, broken out of ...
484 (dump_data): ... here. Call it.
485 (dump_strings): New function.
486
4872007-08-31 Roland McGrath <roland@redhat.com>
488
489 * readelf.c (print_strings): Typo fix.
490
Roland McGrathcb6d8652007-08-23 08:10:54 +00004912007-08-23 Roland McGrath <roland@redhat.com>
492
493 * readelf.c (printf_with_wrap): Function removed.
494 (REGISTER_WRAP_COLUMN): New macro.
495 (handle_core_register): Use print_core_item instead.
496 (struct register_info): New type.
497 (compare_registers, compare_register_sets): New functions.
498 (register_bitpos, compare_sets_by_info): New functions.
499 (handle_core_registers): Use those to segregate and sort registers
500 for display.
501
502 * readelf.c (ITEM_WRAP_COLUMN): New macro.
503 (print_core_item): New function.
504 (handle_core_item): Use it instead of printf_with_wrap.
505 (compare_core_items, compare_core_item_groups): New functions.
506 (handle_core_items): Use them. Sort by group and force line breaks
507 between groups.
508
509 * readelf.c (handle_core_registers, handle_core_items): New functions,
510 broken out of ...
511 (handle_core_note): ... here. Call them.
512
5132007-08-22 Roland McGrath <roland@redhat.com>
514
515 * unstrip.c (new_shstrtab): New function, broken out of ...
516 (copy_elided_sections): ... here.
517
5182007-08-20 Roland McGrath <roland@redhat.com>
519
520 Avoid local function trampolines in nm binary.
521 * nm.c (sort_by_address): Move to a static function instead of local
522 inside show_symbols.
523 (sort_by_name_strtab): New static variable.
524 (sort_by_name): Use it. Move to a static function instead of local
525 inside show_symbols.
526 (show_symbols): Set sort_by_name_strtab.
527
5282007-08-19 Roland McGrath <roland@redhat.com>
529
530 * readelf.c (handle_auxv_note): New function.
531 (handle_notes): Call it.
532
533 * readelf.c (printf_with_wrap, convert): New functions.
534 (handle_core_item, (handle_core_register): New functions.
535 (handle_notes): Call those with details from ebl_core_note.
536
Roland McGrath099dd522007-08-13 22:58:36 +00005372007-08-12 Roland McGrath <roland@redhat.com>
538
539 * elflint.c (check_note): Accept type 0 with name "Linux".
540
541 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
542
543 * elflint.c (section_flags_string): Return "none" for 0, not "".
544
Roland McGrathd8221722007-08-11 21:18:09 +00005452007-08-11 Roland McGrath <roland@redhat.com>
546
547 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
548
Ulrich Drepperc98bcc72007-08-04 17:06:14 +00005492007-08-04 Ulrich Drepper <drepper@redhat.com>
550
551 * readelf.c (hex_dump): Use isprint to determine whether to print
552 character itself or full stop character.
553 (dump_data): No need to check endp for NULL after strtol call.
554
Roland McGrath60fc84c2007-08-03 21:59:15 +00005552007-08-03 Roland McGrath <roland@redhat.com>
556
557 * readelf.c (print_string_sections): New variable.
558 (options, parse_opt): Handle --strings/-p to set it.
559 (print_strings): New function.
560 (process_elf_file): Call it under -p.
561
562 * readelf.c (options): Add hidden aliases --segments, --sections,
563 as taken by binutils readelf.
564
5652007-08-01 Roland McGrath <roland@redhat.com>
566
567 * readelf.c (dump_data_sections, dump_data_sections_tail):
568 New variables.
569 (options, parse_opt): Handle --hex-dump/-x, set them.
570 (hex_dump): New function.
571 (dump_data): New function, call it.
572 (process_elf_file): Call it.
573
5742007-07-25 Roland McGrath <roland@redhat.com>
575
576 * addr2line.c (show_symbols): New variable.
577 (print_addrsym): New function.
578 (handle_address): Call it.
579 (options, parse_opt): Handle -S/--symbols.
580
Ulrich Drepperb0243862007-06-06 00:09:36 +00005812007-06-05 Ulrich Drepper <drepper@redhat.com>
582
583 * addr2line.c: Update for latest autoconf header.
584 * ar.c: Likewise.
585 * elfcmp.c: Likewise.
586 * elflint.c: Likewise.
587 * findtextrel.c: Likewise.
588 * ld.c: Likewise.
589 * ldgeneric.c: Likewise.
590 * nm.c: Likewise.
591 * objdump.c: Likewise.
592 * ranlib.c: Likewise.
593 * readelf.c: Likewise.
594 * size.c: Likewise.
595 * strings.c: Likewise.
596 * strip.c: Likewise.
597 * unstrip.c: Likewise.
598
Roland McGrath9aa8ef72007-05-18 08:59:43 +00005992007-05-18 Roland McGrath <roland@redhat.com>
600
601 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
602 stripped file, so as not to duplicate a section copied in both.
603
604 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
605
6062007-05-17 Roland McGrath <roland@redhat.com>
607
608 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
609
610 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
611
612 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
613 call make_directories here.
614 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
615 (handle_dwfl_module): Likewise.
616 (handle_implicit_modules): Update callers.
617 (handle_output_dir_module): Likewise. Don't do make_directories here.
618
619 * unstrip.c (get_section_name): New function, broken out of ...
620 (copy_elided_sections): here. Update callers.
621 (find_alloc_section): Broken out of ...
622 (copy_elided_sections): ... here. Update caller.
623 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
624 update STT_SECTION symbols' st_value fields as a side effect.
625 (check_symtab_section_symbols): Update caller.
626 (add_new_section_symbols): Set st_value in symbols added.
627 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
628 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
629 from .bss to .dynbss.
630 (find_alloc_sections_prelink): New function. Associate debug file
631 allocated SHT_NOBITS shdrs with stripped moved by prelink via
632 .gnu.prelink_undo information.
633 (copy_elided_sections): Call it when we couldn't find every allocated
634 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
635 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
636 (handle_file): Update callers.
637
638 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
639 named ".comment".
640
641 * elflint.c (check_sections): Fix association of segments with
642 sections when p_memsz > p_filesz.
643
6442007-04-29 Roland McGrath <roland@redhat.com>
645
646 * addr2line.c (options, main): Tweak argp group settings to fix
647 usage output.
648
6492007-04-28 Roland McGrath <roland@redhat.com>
650
651 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
652 sizes to match sections adjusted in the stripped file.
653
Roland McGrath4be15242007-04-25 03:09:33 +00006542007-04-24 Roland McGrath <roland@redhat.com>
655
656 * elfcmp.c (OPT_HASH_INEXACT): New macro.
657 (hash_inexact): New variable.
658 (options, parse_opt): Add --hash-inexact option to set it.
659 (hash_content_equivalent): New function.
660 (main): Call it for differing SHT_HASH sections under --hash-inexact.
661
6622007-04-23 Roland McGrath <roland@redhat.com>
663
664 * unstrip.c: New file.
665 * Makefile.am (bin_PROGRAMS): Add it.
666 (unstrip_LDADD): New variable.
667
668 * strip.c (options): Allow --output for -o.
669
Ulrich Drepper8b383102007-02-16 00:31:57 +00006702007-02-15 Ulrich Drepper <drepper@redhat.com>
671
672 * readelf.c: Remove unused code. Add a few consts.
673
Ulrich Drepper903c1162007-02-15 19:40:37 +00006742007-02-15 Roland McGrath <roland@redhat.com>
675
676 * readelf.c (print_debug): Fix brainos in SHDR test.
677
Roland McGrathf82a1ec2007-02-06 04:47:44 +00006782007-02-05 Roland McGrath <roland@redhat.com>
679
680 * ar.c: Include <limits.h>, since we use LONG_MAX.
681
Ulrich Drepper0fe63532007-02-05 21:05:51 +00006822007-02-05 Ulrich Drepper <drepper@redhat.com>
683
Ulrich Drepper8b383102007-02-16 00:31:57 +0000684 * ar.c: Add ugly hack to work around gcc complaining that we
Ulrich Drepper93ab56f2007-02-05 22:12:41 +0000685 ignore fchown's return value.
686 (do_oper_insert): Handle error when writing padding.
687 * ranlib.c: Add fchown complain work around.
688
Ulrich Drepper0fe63532007-02-05 21:05:51 +0000689 * arlib.c: Make symtab a global variable. Change all users.
690 * arlib2.c: Likewise.
691 * ranlib.c: Likewise.
692 * ar.c: Likewise.
693 * arlib.h: Declare it.
694
Ulrich Drepperaa915fd2007-02-05 07:25:33 +00006952007-01-11 Roland McGrath <roland@redhat.com>
696
697 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
698 SHF_MASKPROC bits separately from generic sh_flags validation.
699
Ulrich Drepperce0bdb62007-02-05 07:13:52 +00007002007-02-04 Ulrich Drepper <drepper@redhat.com>
701
702 * ar.c: New file.
703 * arlib.c: New file.
704 * arlib2.c: New file.
705 * arlib.h: New file.
706 * Makefile (noinst_LIBRARIES): Add libar.
707 (libar_a_SOURCES): Define.
708 (ar_LDADD): Define.
709 (CFLAGS_ar): Define.
710 * ranlib.c: Change to use arlib.
711
712 * elflint.c (check_symtab): Work around GNU ld bug which omits
713 sections but not symbols in those sections.
714
Ulrich Drepperb770cf92007-01-10 21:02:34 +00007152007-01-10 Ulrich Drepper <drepper@redhat.com>
716
717 * addr2line.c: Update copyright year.
718 * elfcmp.c: Likewise.
719 * elflint.c: Likewise.
720 * findtextrel.c: Likewise.
721 * ld.c: Likewise.
722 * nm.c: Likewise.
723 * objdump.c: Likewise.
724 * ranlib.c: Likewise.
725 * readelf.c: Likewise.
726 * size.c: Likewise.
727 * strings.c: Likewise.
728 * strip.c: Likewise.
729
Ulrich Drepper7c0e79f2006-12-09 21:10:19 +00007302006-12-09 Ulrich Drepper <drepper@redhat.com>
731
732 * elflint.c (compare_hash_gnu_hash): New function. Report if the
733 two hash tables have different content (module expected omission
734 of undefined symbols).
735
Roland McGrath8190db62006-12-17 23:56:51 +00007362006-10-31 Roland McGrath <roland@redhat.com>
737
738 * elflint.c (check_program_header): Don't complain about
Ulrich Drepper56bc0b82006-12-18 22:38:08 +0000739 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
Roland McGrath8190db62006-12-17 23:56:51 +0000740
7412006-09-19 Jakub Jelinek <jakub@redhat.com>
742
743 * strip.c (process_file): Disallow -f on archives.
744
7452006-10-09 Roland McGrath <roland@redhat.com>
746
747 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
748
Roland McGrathc373d852006-10-10 00:25:21 +00007492006-08-29 Roland McGrath <roland@redhat.com>
750
751 * Makefile.am (MAINTAINERCLEANFILES): New variable.
752
753 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
754 Reported by Christian Aichinger <Greek0@gmx.net>.
755
756 * elflint.c (valid_e_machine): Add EM_ALPHA.
757 Reported by Christian Aichinger <Greek0@gmx.net>.
758
Ulrich Drepper231c5902006-08-08 22:00:11 +00007592006-08-08 Ulrich Drepper <drepper@redhat.com>
760
761 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
762 Keep track of which "high DT" entries are present.
763 Check that either old or GNU-style hash table is present.
764 If GNU-style hash table is used a symbol table is mandatory.
765 Check that if any prelink entry is present all of them are.
766 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
767 table if they don't refer to functions.
768
Roland McGrath858b1892006-07-17 08:41:15 +00007692006-07-17 Roland McGrath <roland@redhat.com>
770
771 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
772 (add_version): Likewise for argument.
773 (check_versym): Cast constant to GElf_Versym for comparison.
774
Roland McGrath4ec807e2006-07-13 03:59:46 +00007752006-07-12 Roland McGrath <roland@redhat.com>
776
777 * readelf.c (handle_gnu_hash): Add casts for machines where
778 Elf32_Word != unsigned int.
779
Ulrich Drepperdcf61602006-07-12 19:59:02 +00007802006-07-12 Ulrich Drepper <drepper@redhat.com>
781
782 * elflint.c (check_sysv_hash64): Fix printf format.
783
Ulrich Dreppercc415622006-07-12 19:42:23 +00007842006-07-11 Roland McGrath <roland@redhat.com>
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000785
Ulrich Dreppercc415622006-07-12 19:42:23 +0000786 * addr2line.c (options): English fix in -f doc string.
787
788 * addr2line.c (use_comp_dir): New variable.
789 (options, parse_opt): Grok -A/--absolute to set it.
790 (handle_address): If set, prepend dwfl_line_comp_dir results to
791 relative file names.
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000792
Ulrich Drepper28ed8952006-07-07 03:43:47 +00007932006-07-06 Ulrich Drepper <drepper@redhat.com>
794
795 * elflint.c: Adjust for latest new hash table format.
796 * readelf.c: Likewise.
797
798 * elflint.c (check_versym): Ignore hidden bit when comparing version
799 numbers.
800
8012006-07-05 Ulrich Drepper <drepper@redhat.com>
802
803 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
804 discarded COMDAT symbols.
805
806 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
807 (elf_i386_create_relocations): Likewise.
808 * ld.h (struct symbol): Add local and hidden bits.
809 * ld.c (create_special_section_symbol): These synthsized symbols
810 are local and hidden.
811 * ldgeneric.c (file_process2): Check whether input file matches
812 the emulation.
813 (fillin_special_symbol): Create symbols as local and/or hidden
814 if requested.
815 (ld_generic_create_outfile): Make local copy of symbol.
816 Don't hide global, defined symbols in dynamic symbol table unless
817 requested. Synthetic symbols have no version information.
818
819 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
820 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
821
8222006-07-04 Ulrich Drepper <drepper@redhat.com>
823
824 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
825 testing.
826
8272006-07-03 Ulrich Drepper <drepper@redhat.com>
828
829 * elflint.c: Add testing of DT_GNU_HASH.
830 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
831
832 * Makefile.am: Add hacks to create dependency files for non-generic
833 linker.
834
Ulrich Drepper6ca46002006-06-12 22:40:23 +00008352006-06-12 Ulrich Drepper <drepper@redhat.com>
836
837 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
838 section if creating a DSO and no interpreter is given.
839 (ld_generic_create_outfile): Don't store reference to symbols in
840 discarded COMDAT groups. Don't create PHDR and INTERP program header
841 for DSO if no interpreter is specified.
Ulrich Drepper595d0e72006-06-12 23:25:17 +0000842 (create_verneed_data): Pretty printing.
843
Ulrich Drepper6ca46002006-06-12 22:40:23 +0000844 * ldscript.y (content): If a DSO is created don't set default
845 interpreter from linker script.
846
847 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
848 for symbols in discarded COMDAT groups.
849 (elf_i386_create_relocations): Likewise.
850 * ld.h (struct scninfo): Add unused_comdat.
851 * ldgeneric.c (add_section): Also check group signature when
852 matching COMDAT sections.
853 (add_relocatable_file): Ignore symbols in COMDAT group which are
854 discarded.
855
856 * elflint.c (check_one_reloc): For *_NONE relocs only check type
857 and symbol reference.
858
Ulrich Drepper54f33a72006-06-11 09:07:37 +00008592006-06-11 Ulrich Drepper <drepper@redhat.com>
860
Ulrich Dreppercbb51e52006-06-11 20:25:23 +0000861 * elflint.c (check_dynamic): Fix checking value of tags which are
862 offsets in the string section. Make sure DT_STRTAB points to the
863 section referenced in sh_link.
864
865 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
866
Ulrich Drepper54f33a72006-06-11 09:07:37 +0000867 * ld.c: Recognize --eh-frame-hdr option.
868 * ld.h (struct ld_state): Add eh_frame_hdr field.
869 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
870
871 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
872 SH_FLAGS_COMBINE.
873 (add_relocatable_file): Minor optimization of last change.
874 (match_section): Don't preserve SHF_GROUP flag any longer.
875
Ulrich Drepper2d880282006-06-11 00:20:43 +00008762006-06-10 Ulrich Drepper <drepper@redhat.com>
877
878 * ld.c (parse_z_option): Recognize execstack and noexecstack.
Ulrich Drepper4f0a7a82006-06-11 00:53:45 +0000879 Handle record and ignore as position dependent options.
880 (parse_z_option_2): Handle ignore and record here.
Ulrich Drepper2d880282006-06-11 00:20:43 +0000881 * ld.h (struct ld_state): Add execstack field.
882 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
883 sections.
884 (ld_generic_create_outfile): Fix program header creation in native
885 linker. Add PT_GNU_STACK program header.
886
Ulrich Dreppera688a732006-06-10 06:33:00 +00008872006-06-09 Ulrich Drepper <drepper@redhat.com>
888
889 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
890 for PLT entries if there is no local definition.
891
892 * ld.c (parse_option): Handle -z ignore like --as-needed and
893 -z record like --no-as-needed.
894 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
895 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
896 looping over DSOs. When deciding about adding DT_NEEDED entries
897 use ->as_needed instead of ignore_unused_dsos.
898
Ulrich Drepper8c56fe32006-05-31 15:50:43 +00008992006-05-31 Ulrich Drepper <drepper@redhat.com>
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000900
Ulrich Drepper8c56fe32006-05-31 15:50:43 +0000901 * ld.c: Recognize --as-needed and --no-as-needed options.
902 * ld.h (struct usedfile): Add as_needed field.
903 (struct ld_state): Likewise.
904 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
905 the list.
906 * ldscript.y (filename_id_list): Split to correctly parse all
907 combinations.
908 (mark_as_needed): Fix loop.
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000909
Ulrich Drepper697f4db2006-06-10 06:50:47 +00009102006-05-28 Ulrich Drepper <drepper@redhat.com>
911
912 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
913 and colno.
914
Ulrich Drepper2cb8e732006-05-27 21:57:27 +00009152006-05-27 Ulrich Drepper <drepper@redhat.com>
916
917 * readelf.c (handle_relocs_rela): Better notations for addon value.
Ulrich Drepper41a99082006-05-28 00:01:43 +0000918 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
Ulrich Drepper2cb8e732006-05-27 21:57:27 +0000919
Ulrich Drepper82c345d2006-04-04 22:07:54 +00009202006-04-04 Ulrich Drepper <drepper@redhat.com>
921
922 * addr2line.c: Update copyright year.
923 * elfcmp.c: Likewise.
924 * elflint.c: Likewise.
925 * findtextrel.c: Likewise.
926 * ld.c: Likewise.
927 * nm.c: Likewise.
928 * objdump.c: Likewise.
929 * ranlib.c: Likewise.
930 * readelf.c: Likewise.
931 * size.c: Likewise.
932 * strings.c: Likewise.
933 * strip.c: Likewise.
934
Roland McGrathdd7e22b2006-03-09 23:05:47 +00009352006-03-09 Roland McGrath <roland@redhat.com>
936
937 * Makefile.am (AM_LDFLAGS): New variable.
938
Roland McGrath060fa052006-03-02 07:51:50 +00009392006-03-01 Roland McGrath <roland@redhat.com>
940
941 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
942 for dwarf.h changes matching 3.0 spec.
943 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
944
Ulrich Drepper038129b2005-12-04 16:47:24 +00009452005-12-04 Ulrich Drepper <drepper@redhat.com>
946
947 * elflint.c (check_one_reloc): If relocation section is not loaded,
948 don't check whether the relocations modify read-only sections or
949 loaded and unloaded sections.
950
Ulrich Drepper607e0542005-12-04 15:51:06 +00009512005-11-28 Ulrich Drepper <drepper@redhat.com>
952
953 * elflint.c (check_one_reloc): Take additional parameters. Use
954 them to determine whether relocation is valid in this type of
955 file. DSOs and executables can contain relocation sections in
956 unloaded sections which just show the relocations the linker
957 applied. Adjust all callers.
958 (check_program_header): Check that PT_PHDR is loaded and that offset
959 matches the one in the ELF header.
960
Roland McGrath6724c902005-10-28 07:07:19 +00009612005-10-26 Roland McGrath <roland@redhat.com>
962
963 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
964
Ulrich Drepperd0449522005-09-03 07:23:52 +00009652005-09-03 Ulrich Drepper <drepper@redhat.com>
966
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000967 * strip.c (handle_elf): Unify some error messages.
968 * ld.c (main): Likewise.
969 * ldgeneric.c (open_elf): Likewise.
970 * elfcmp.c (main): Likewise.
971 * elflint.c (check_elf_header): Likewise.
972
973 * size.c (process_file): Fix typo in error message.
974
Ulrich Drepperd0449522005-09-03 07:23:52 +0000975 * readelf.c: Lots of little cleanups. Use _unlocked functions.
976
Ulrich Dreppera60501e2005-09-02 19:50:17 +00009772005-09-02 Ulrich Drepper <drepper@redhat.com>
978
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000979 * strings.c (main): Reset elfmap variable after munmap call.
Ulrich Drepper618795f2005-09-02 20:01:37 +0000980 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
Ulrich Dreppera60501e2005-09-02 19:50:17 +0000981
Ulrich Drepperfbe998a2005-08-29 16:27:10 +00009822005-08-28 Ulrich Drepper <drepper@redhat.com>
983
984 * ranlib.c: Don't define pread_retry and write_retry here.
985
986 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
987 (CLEANFILES): Add *.gcno *.gcda *.gconv.
988
989 * strings.c (process_chunk): Reorder expressions in conditional
990 (process_chunk_mb): Likewise.
991
992 * strings.c: New file.
993 * Makefile.am (bin_PROGRAMS): Add strings.
994 (strings_no_Wstring): Define.
995 (strings_LDADD): Define.
996
Roland McGrath71e15a02005-08-27 10:33:26 +00009972005-08-27 Roland McGrath <roland@redhat.com>
998
999 * addr2line.c (dwarf_diename_integrate): Function removed.
1000 (print_dwarf_function): Use plain dwarf_diename.
1001
Ulrich Drepperc5a06cd2005-08-24 19:50:14 +000010022005-08-24 Ulrich Drepper <drepper@redhat.com>
1003
1004 * elflint.c (check_versym): Versioned symbols should not have
1005 local binding.
1006
Ulrich Drepper5d832292005-08-15 21:36:27 +000010072005-08-15 Ulrich Drepper <drepper@redhat.com>
1008
Ulrich Drepper61655e02005-08-16 04:23:02 +00001009 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
1010 undefined.
1011
Ulrich Drepper5d832292005-08-15 21:36:27 +00001012 * Makefile.am: Add rules to build ranlib.
1013 * ranlib.c: New file.
1014
Roland McGrath18e13422005-08-15 08:01:25 +000010152005-08-14 Roland McGrath <roland@redhat.com>
1016
1017 * elflint.c (check_sections): Use ebl_section_type_name and allow any
1018 sh_type it recognizes.
1019
1020 * elflint.c (check_sections): Print unknown flags in hex, don't
1021 truncate high bits. Print section number and name for unknown type.
1022
Roland McGrathf6895042005-08-13 20:56:52 +000010232005-08-13 Roland McGrath <roland@redhat.com>
1024
1025 * elflint.c (check_program_header): Use ebl_segment_type_name and
1026 allow any p_type it recognizes. Include p_type value in error
1027 message for unknown type.
1028
Ulrich Drepperc5c33a62005-08-13 17:50:47 +000010292005-08-13 Ulrich Drepper <drepper@redhat.com>
1030
1031 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
1032 to ebl_check_special_symbol.
1033 (check_sections): Pass ehdr to ebl_bss_plt_p.
1034
Roland McGrath653d3762005-08-13 01:59:10 +000010352005-08-12 Roland McGrath <roland@redhat.com>
1036
1037 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
1038 refers to the right section if it's not SHN_ABS.
1039 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
1040
1041 * elflint.c (check_sections): Don't complain about a non-NOBITS
1042 section taking no segment space, if it's sh_size is 0.
1043
1044 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
1045 be PROGBITS or NOBITS.
1046
1047 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
1048 standard st_value and st_size checks.
1049
Roland McGrath1c83bf12005-08-11 07:03:55 +000010502005-07-28 Roland McGrath <roland@redhat.com>
Ulrich Drepperfaf4d192005-08-11 05:12:05 +00001051
Roland McGrath1c83bf12005-08-11 07:03:55 +00001052 * addr2line.c (options, parse_opt): Don't handle -e here.
1053 (executable): Variable removed.
1054 (argp_children): New static variable.
1055 (argp): Use it. Make const.
1056 (main): Fill in argp_children from dwfl_standard_argp ().
1057 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1058 (print_dwarf_function): New function. Try to figure out inline chain.
1059 (elf_getname): Function removed, libdwfl does it for us.
1060 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1061 Use dwfl_module_addrname instead of elf_getname.
1062 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1063 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1064
10652005-08-10 Ulrich Drepper <drepper@redhat.com>
1066
1067 * strip.c (parse_opt): STATE parameter is now used.
1068 Various little cleanups.
1069
1070 * readelf.c (print_debug_line_section): Correct fallout of renaming
1071 of DW_LNS_set_epilog_begin.
Ulrich Drepper6d5c3bd2005-08-11 04:37:52 +00001072
Roland McGrath8f31c2c2005-08-09 04:58:05 +000010732005-08-08 Roland McGrath <roland@redhat.com>
1074
1075 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1076 with binutils strip. Likewise -d, -S, as aliases for -g.
1077 Likewise ignore -s/--strip-all.
1078
Roland McGrath095a01b2005-08-08 03:49:35 +000010792005-08-07 Roland McGrath <roland@redhat.com>
1080
1081 * strip.c (process_file): Open read-only when using a different output
1082 file.
1083
Ulrich Drepper47be7952005-08-07 04:41:39 +000010842005-08-06 Ulrich Drepper <drepper@redhat.com>
1085
Ulrich Drepper637963b2005-08-07 05:33:07 +00001086 * elflint.c (in_nobits_scn): New function.
1087 (check_versym): Allow references for defined symbols against versions
1088 of other DSOs also for symbols in nobits sections.
1089 Move a few variables around.
1090
Ulrich Drepper47be7952005-08-07 04:41:39 +00001091 * Makefile.am (AM_CFLAGS): Avoid duplication.
1092 Link with statis libs if BUILD_STATIC.
1093
Ulrich Drepperdbace232005-08-06 01:37:23 +000010942005-08-05 Ulrich Drepper <drepper@redhat.com>
1095
1096 * elflint.c: Many, many more tests. Mostly related to symbol
1097 versioning. Those sections should now be completely checked.
1098
1099 * readelf.c (print_dynamic): Use gelf_offscn.
1100
Ulrich Drepperacb89832005-08-04 07:01:49 +000011012005-08-04 Ulrich Drepper <drepper@redhat.com>
1102
1103 * elflint.c: Add lots more tests: more extension symbol table sanity,
1104 versioning section tests, hash table tests. General cleanup.
1105
Ulrich Drepperc911c9e2005-08-02 16:07:42 +000011062005-08-02 Ulrich Drepper <drepper@redhat.com>
1107
Ulrich Drepper8a687742005-08-03 02:24:12 +00001108 * objdump.c: New file.
1109 * Makefile.am (bin_PROGRAMS): Add objdump.
1110 (objdump_LDADD): Define.
1111
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001112 * elflint.c (check_reloc_shdr): New function split out from check_rela
1113 and check_rel.
1114 (check_one_reloc): New function. Likewise.
1115 (check_rela): Use check_reloc_shdr and check_one_reloc.
1116 (check_rel): Likewise.
Ulrich Drepper41de4882005-08-03 00:02:56 +00001117 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
1118 section.
1119 Add checks that relocations against read-only segments are flagged,
1120 that the text relocation flag is not set unnecessarily, and that
1121 relocations in one section are either against loaded or not-loaded
1122 segments.
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001123
Ulrich Drepper8533dcf2005-08-01 07:18:47 +000011242005-08-01 Ulrich Drepper <drepper@redhat.com>
1125
1126 * elfcmp.c (main): Ignore section count and section name string table
1127 section index.
1128
Roland McGrathf9ece8a2005-07-28 07:03:04 +000011292005-07-27 Roland McGrath <roland@redhat.com>
1130
1131 * elfcmp.c: Include <locale.h>.
1132
Ulrich Drepper7d48d6a2005-07-27 10:13:23 +000011332005-07-27 Ulrich Drepper <drepper@redhat.com>
1134
1135 * elfcmp.c: Print name and index of differing section.
1136
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000011372005-07-24 Ulrich Drepper <drepper@redhat.com>
1138
1139 * elfcmp.c: Implement comparing gaps between sections.
1140
11412005-07-23 Ulrich Drepper <drepper@redhat.com>
1142
1143 * elflint.c: Include libeblP.h instead of libebl.h.
1144 * nm.c: Likewise.
1145 * readelf.c: Likewise.
1146 * elfcmp.c: Likewise.
1147
1148 * elfcmp.c (main): Compare individual ELF header fields, excluding
1149 e_shoff instead of the whole struct at once.
1150 Use ebl_section_strip_p instead of SECTION_STRIP_P.
1151 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
1152
11532005-07-22 Ulrich Drepper <drepper@redhat.com>
1154
1155 * elfcmp.c (main): Take empty section into account when comparing
1156 section content.
1157
1158 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
1159 using it.
1160
11612005-07-21 Ulrich Drepper <drepper@redhat.com>
1162
1163 * elfcmp.c: New file.
1164 * Makefile.am (bin_PROGRAMS): Add elfcmp.
1165 (elfcmp_LDADD): Define.
1166
1167 * elflint.c (check_rela): Check that copy relocations only reference
1168 object symbols or symbols with unknown type.
1169 (check_rel): Likewise.
1170
11712005-06-08 Roland McGrath <roland@redhat.com>
1172
1173 * readelf.c (print_ops): Add consts.
1174
11752005-05-31 Roland McGrath <roland@redhat.com>
1176
1177 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
1178 abbreviations. Print a header line before each CU section.
1179
1180 * readelf.c (print_debug_loc_section): Fix indentation for larger
1181 address size.
1182
11832005-05-30 Roland McGrath <roland@redhat.com>
1184
1185 * readelf.c (print_debug_line_section): Print section offset of each
1186 CU's table, so they are easy to find from seeing the stmt_list value.
1187
1188 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
1189 (attr_callback): Grok DW_AT_ranges and print offset in hex.
1190
1191 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
1192 (print_debug_ranges_section, print_debug_loc_section): Likewise.
1193
1194 * readelf.c (print_ops): Take different args for indentation control.
1195 (attr_callback): Caller updated.
1196 Grok several more block-form attributes as being location expressions.
1197 For those same attributes with udata forms, format output differently
1198 for location list offset.
1199 (print_debug_loc_section): Implement it for real.
1200
1201 * readelf.c (options): Mention ranges for --debug-dump.
1202 (enum section_e): Add section_ranges.
1203 (parse_opt): Grok "ranges" for -w/--debug-dump.
1204 (print_debug_ranges_section): New function.
1205 (print_debug): Handle .debug_ranges section.
1206
12072005-05-30 Ulrich Drepper <drepper@redhat.com>
1208
1209 * readelf.c (handle_notes): At least x86-64 need not have the note
1210 section values aligned to 8 bytes.
1211
12122005-05-18 Ulrich Drepper <drepper@redhat.com>
1213
1214 * readelf.c (dwarf_tag_string): Add new tags.
1215
12162005-05-08 Roland McGrath <roland@redhat.com>
1217
1218 * strip.c (handle_elf): Don't translate hash and versym data formats,
1219 elf_getdata already did it for us.
1220
12212005-05-07 Ulrich Drepper <drepper@redhat.com>
1222
1223 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
1224 (addr2line_LDADD): Likewise.
1225
12262005-05-03 Roland McGrath <roland@redhat.com>
1227
1228 * strip.c (handle_elf): Apply symbol table fixups to discarded
1229 relocation sections when they are being saved in the debug file.
1230
1231 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
1232 and gelf_xlatetof, not the native byte order.
1233
1234 * strip.c (parse_opt): Give error if -f or -o is repeated.
1235 (main): Exit if argp_parse returns nonzero.
1236
1237 * strip.c (debug_fname_embed): New variable.
1238 (options, parse_opt): New option -F to set it.
1239
12402005-05-07 Ulrich Drepper <drepper@redhat.com>
1241
1242 * readelf.c (parse_opt): Make any_control_option variable
1243 local. Simplify some tests.
1244
12452005-05-03 Roland McGrath <roland@redhat.com>
1246
1247 * strip.c (crc32_file): Function removed (now in ../lib).
1248
12492005-05-03 Roland McGrath <roland@redhat.com>
1250
1251 * elflint.c (is_debuginfo): New variable.
1252 (options, parse_opt): New option --debuginfo/-d to set it.
1253 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
1254 (check_note): If is_debuginfo, don't try to get note contents.
1255
12562005-04-24 Ulrich Drepper <drepper@redhat.com>
1257
1258 * readelf.c (print_debug_abbrev_section): Don't print error when end of
1259 section reached.
1260
12612005-04-14 Ulrich Drepper <drepper@redhat.com>
1262
1263 * readelf.c (dwarf_encoding_string): New function.
1264 (dwarf_inline_string): New function.
1265 (dwarf_access_string): New function.
1266 (dwarf_visibility_string): New function.
1267 (dwarf_virtuality_string): New function.
1268 (dwarf_identifier_case_string): New function.
1269 (dwarf_calling_convention_string): New function.
1270 (dwarf_ordering_string): New function.
1271 (dwarf_discr_list_string): New function.
1272 (attr_callback): Decode man more attribute values.
1273
12742005-04-01 Ulrich Drepper <drepper@redhat.com>
1275
1276 * addr2line.c: Finish implementation of -f option.
1277
12782005-03-29 Ulrich Drepper <drepper@redhat.com>
1279
1280 * addr2line.c: New file.
1281 * Makefile.am (bin_PROGRAMS): Add addr2line.
1282 Define addr2line_LDADD.
1283
1284 * findtextrel.c: Use new dwarf_addrdie function.
1285
1286 * findtextrel.c: Fix usage message and re-add accidentally removed
1287 line.
1288
12892005-03-28 Ulrich Drepper <drepper@redhat.com>
1290
1291 * findtextrel.c: New file.
1292 * Makefile: Add rules to build findtextrel.
1293
12942005-02-15 Ulrich Drepper <drepper@redhat.com>
1295
1296 * ldlex.l: Provide ECHO definition to avoid warning.
1297
1298 * elflint.c (check_program_header): Fix typo in RELRO test.
1299
1300 * Makefile.am (AM_CFLAGS): Add more warning options.
1301 * elflint.c: Fix warnings introduced by the new warning options.
1302 * i386_ld.c: Likewise.
1303 * ld.c: Likewise.
1304 * ld.h: Likewise.
1305 * ldgeneric.c: Likewise.
1306 * nm.c: Likewise.
1307 * readelf.c: Likewise.
1308 * sectionhash.c: Likewise.
1309 * size.c: Likewise.
1310 * string.c: Likewise.
1311
13122005-02-05 Ulrich Drepper <drepper@redhat.com>
1313
1314 * Makefile.am: Check for text relocations in constructed DSOs.
1315
1316 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
1317 with -lmudflap.
1318
1319 * ldscript.y: Add as_needed handling.
1320 * ldlex.l: Recognize AS_NEEDED token.
1321 * ld.h (struct filename_list): Add as_needed flag.
1322
13232005-02-04 Ulrich Drepper <drepper@redhat.com>
1324
1325 * elflint.c (check_symtab): Correctly determine size of GOT section.
1326
13272005-01-19 Ulrich Drepper <drepper@redhat.com>
1328
1329 * ld.c: Remove unnecessary more_help function. Print bug report
1330 address using argp.
1331 * strip.c: Likewise.
1332 * size.c: Likewise.
1333 * nm.c: Likewise.
1334 * readelf.c: Likewise.
1335 * elflint.c: Likewise.
1336
1337 * elflint.c (main): Don't check for parameter problems here.
1338 (parse_opt): Do it here, where we get informed about some of them
1339 anyway.
1340
1341 * readelf.c (main): Don't check for parameter problems here.
1342 (parse_opt): Do it here, where we get informed about some of them
1343 anyway.
1344
13452005-01-11 Ulrich Drepper <drepper@redhat.com>
1346
1347 * strip.c: Update copyright year.
1348 * readelf.c: Likewise.
1349 * size.c: Likewise.
1350 * nm.c: Likewise.
1351 * ld.c: Likewise.
1352 * elflint.c: Likewise.
1353
1354 * elflint.c (check_symtab): Don't warn about wrong size for
1355 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
1356
13572004-10-05 Ulrich Drepper <drepper@redhat.com>
1358
1359 * readelf.c (print_phdr): In section mapping, also indicate
1360 sections in read-only segments.
1361
13622004-09-25 Ulrich Drepper <drepper@redhat.com>
1363
1364 * readelf.c: Make compile with gcc 4.0.
1365 * strip.c: Likewise.
1366
13672004-08-16 Ulrich Drepper <drepper@redhat.com>
1368
1369 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
1370 allocate to work around gcc 3.4 bug.
1371
13722004-01-25 Ulrich Drepper <drepper@redhat.com>
1373
1374 * ldlex.l (invalid_char): Better error message.
1375
13762004-01-23 Ulrich Drepper <drepper@redhat.com>
1377
1378 * readelf.c: Print SHT_GNU_LIBLIST sections.
1379
1380 * none_ld.c: New file.
1381
13822004-01-21 Ulrich Drepper <drepper@redhat.com>
1383
1384 * Makefile.am: Enable building of machine specific linker.
1385
13862004-01-20 Ulrich Drepper <drepper@redhat.com>
1387
1388 * Makefile.am: Support building with mudflap.
1389
1390 * i386_ld.c: Fix warnings gcc 3.4 spits out.
1391 * ldgeneric.c: Likewise.
1392 * ldscript.y: Likewise.
1393 * readelf.c: Likewise.
1394 * strip.c: Likewise.
1395
1396 * readelf.c (print_debug_line_section): Determine address size
1397 correctly.
1398
13992004-01-19 Ulrich Drepper <drepper@redhat.com>
1400
1401 * readelf.c (print_phdr): Show which sections are covered by the
1402 PT_GNU_RELRO entry.
1403
1404 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
1405
1406 * readelf.c (print_debug_macinfo_section): Implement.
1407
14082004-01-18 Ulrich Drepper <drepper@redhat.com>
1409
1410 * readelf.c (print_debug_line_section): Implement.
1411
14122004-01-17 Ulrich Drepper <drepper@redhat.com>
1413
1414 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
1415 * src/ld.c: Likewise.
1416 * src/nm.c: Likewise.
1417 * src/readelf.c: Likewise.
1418 * src/size.c: Likewise.
1419 * src/strip.c: Likewise.
1420
1421 * strip.c: Add a few more unlikely. Reduce scope of some variables.
1422
1423 * Makefile.am: Support building with mudflap.
1424
14252004-01-16 Ulrich Drepper <drepper@redhat.com>
1426
1427 * readelf.c (print_debug_info_section): Free dies memory.
1428
1429 * readelf.c: Print .debug_info section content.
1430
14312004-01-13 Ulrich Drepper <drepper@redhat.com>
1432
1433 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
1434
14352004-01-12 Ulrich Drepper <drepper@redhat.com>
1436
1437 * readelf.c (print_debug_aranges): Implement using libdw.
1438
14392004-01-11 Ulrich Drepper <drepper@redhat.com>
1440
1441 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
1442
1443 * readelf.c: Use libdw instead of libdwarf. Not all of the old
1444 behavior is available yet.
1445 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
1446
14472004-01-09 Ulrich Drepper <drepper@redhat.com>
1448
1449 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
1450
1451 * nm.c: Implement getting information about local variables.
1452
14532004-01-07 Ulrich Drepper <drepper@redhat.com>
1454
1455 * nm.c: Read also debug information for local symbols.
1456
14572004-01-05 Ulrich Drepper <drepper@redhat.com>
1458
1459 * nm.c: Shuffle dwarf handling code around so the maximum column
1460 width can be computed ahead of printing. Avoid collection symbols
1461 which are not printed anyway.
1462
1463 * nm.c: Rewrite dwarf handling to use libdw.
1464 * Makefile.am (AM_CFLAGS): Add -std parameter.
1465 (INCLUDES): Find header in libdw subdir.
1466 (nm_LDADD): Replace libdwarf with libdw.
1467
1468 * elflint.c: Update copyright year.
1469 * readelf.c: Likewise.
1470 * size.c: Likewise.
1471 * strip.c: Likewise.
1472 * nm.c: Likewise.
1473
14742003-12-31 Ulrich Drepper <drepper@redhat.com>
1475
1476 * strip.c (process_file): Close file before returning.
1477
14782003-11-19 Ulrich Drepper <drepper@redhat.com>
1479
1480 * readelf.c (handle_dynamic): Make column for tag name wider.
1481
14822003-09-29 Ulrich Drepper <drepper@redhat.com>
1483
1484 * readelf.c (handle_dynamic): Always terminate tag name with a space.
1485
14862003-09-25 Ulrich Drepper <drepper@redhat.com>
1487
1488 * strip.c (process_file): Don't mmap the input file, we modify the
1489 data structures and don't want the change end up on disk.
1490
14912003-09-23 Jakub Jelinek <jakub@redhat.com>
1492
1493 * unaligned.h (union u_2ubyte_unaligned,
1494 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
1495 packed attribute.
1496 (add_2ubyte_unaligned, add_4ubyte_unaligned,
1497 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
1498 Read/store value through _ptr->u instead of *_ptr.
1499
15002003-09-22 Ulrich Drepper <drepper@redhat.com>
1501
1502 * size.c (show_sysv): Change type of maxlen to int.
1503
1504 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
1505 buckets.
1506
1507 * i386_ld.c: Many many fixes and extensions.
1508 * ld.c: Likewise.
1509 * ldgeneric.c: Likewise.
1510
15112003-08-16 Ulrich Drepper <drepper@redhat.com>
1512
1513 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
1514 the reference is from another DSO.
1515
15162003-08-15 Ulrich Drepper <drepper@redhat.com>
1517
1518 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
1519 point is found when creating a DSO.
1520
15212003-08-14 Ulrich Drepper <drepper@redhat.com>
1522
1523 * ld.c (main): Always call FLAG_UNRESOLVED.
1524 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
1525 undefined symbols if not creating DSO or ld_state.nodefs is not set.
1526
15272003-08-13 Ulrich Drepper <drepper@redhat.com>
1528
1529 * Makefile.in: Depend on libebl.a, not libebl.so.
1530
1531 * ld.c (main): Mark stream for linker script as locked by caller.
1532 (read_version_script): Likewise.
1533 * ldlex.c: Define fread and fwrite to _unlocked variant.
1534
1535 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
1536 target_bswap_32.
1537 * unaligned.h: Define target_bswap_16, target_bswap_32, and
1538 target_bswap_64.
1539 (store_2ubyte_unaligned, store_4ubyte_unaligned,
1540 store_8ubyte_unaligned): Define using new macros.
1541
15422003-08-12 Ulrich Drepper <drepper@redhat.com>
1543
1544 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
1545 possibly unaligned memory. Support use of big endian machines.
1546
15472003-08-11 Ulrich Drepper <drepper@redhat.com>
1548
1549 * Moved to CVS archive.