blob: 94444c581cbe1f4830e9496c30007c1b090b7b63 [file] [log] [blame]
Roland McGrath521c47d2008-04-11 07:01:58 +000012008-04-10 Roland McGrath <roland@redhat.com>
2
3 * strip.c (handle_elf): Don't keep sections that kept symbol tables
4 refer to. Instead, just be sure to preserve the original symbol
5 table in the debug file so those symbols go with their sections and
6 can be elided from the stripped version of the symbol table.
7
8 * strip.c (handle_elf): When a discarded section kept in the debug
9 file refers to a nondiscard section via sh_link/sh_info, preserve
10 that nondiscarded section unmodified in the debug file as well.
11 Skip adjustment of discarded sections symbol table references when
12 that symbol table is copied in this way.
13
14 * elflint.c (check_symtab): Don't crash from missing symbol names
15 after diagnosing bogus strtab.
16
17 * strip.c (handle_elf): Cosmetic cleanup in special section contents
18 adjustment for symtab changes.
19
Roland McGrath13b69602008-04-01 02:30:05 +0000202008-03-31 Roland McGrath <roland@redhat.com>
21
22 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
23 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
24 excuse a special section.
25
262008-03-27 Roland McGrath <roland@redhat.com>
27
28 * elflint.c (check_sections): Check that executability and writability
29 of sections is reflected in segment p_flags.
30
Roland McGrathd11f9cb2008-03-26 20:51:59 +0000312008-03-26 Roland McGrath <roland@redhat.com>
32
33 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
34 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
35 is valid in RELRO.
36
Roland McGrath47c5c352008-02-29 10:17:16 +0000372008-02-29 Roland McGrath <roland@redhat.com>
38
39 * readelf.c (print_attributes): Add a cast.
40 * elflint.c (check_attributes): Likewise.
41
42 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
43 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
44 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
45
Ulrich Drepper834de6f2008-02-23 06:50:01 +0000462008-02-03 Ulrich Drepper <drepper@redhat.com>
47
48 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
49 when linked into executable.
50 (elf_i386_create_relocations): Likewise.
51
Roland McGrath059c83e2008-02-21 06:19:39 +0000522008-02-20 Roland McGrath <roland@redhat.com>
53
54 * readelf.c (print_attributes): New function.
55 (process_elf_file): Call it under -A.
56
57 * elflint.c (check_attributes): Implement it for real.
58
592008-02-19 Roland McGrath <roland@redhat.com>
60
61 * elflint.c (special_sections): Handle .gnu.attributes section.
62 (check_sections): Likewise.
63 (check_attributes): New function.
64
652008-02-10 Roland McGrath <roland@redhat.com>
66
67 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
68 sections and ET_REL files.
69
Ulrich Drepper712d78e2008-02-02 10:01:53 +0000702008-02-02 Ulrich Drepper <drepper@redhat.com>
71
72 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
73 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
74 and R_386_TLS_LE.
75 (elf_i386_create_relocations): Likewise.
76 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
77 elements.
78 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
79 (ld_generic_create_outfile): Add PT_TLS entry to program header.
80 Fix generation of PT_GNU_STACK entry.
81
Ulrich Drepperc54785a2008-02-01 18:05:21 +0000822008-02-01 Ulrich Drepper <drepper@redhat.com>
83
Ulrich Drepper7cd1bf72008-02-01 23:52:59 +000084 * ld.c (replace_args): Prevent loop over replacements if the parameter
85 is only two characters long.
86
Ulrich Drepperc54785a2008-02-01 18:05:21 +000087 * ld.c: Recognize sha1 argument for --build-id parameter.
88 * ldgeneric.c (create_build_id_section): Handle sha1.
89 (compute_hash_sum): New function. Broken out of compute_build_id.
90 Take hash function and context as parameters.
91 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
92 implementation.
93
Ulrich Drepper89759c72008-01-31 19:44:12 +0000942008-01-31 Ulrich Drepper <drepper@redhat.com>
95
96 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
97 * ld.c: Recognize --build-id command line parameter.
98 * ld.h: Define scn_dot_note_gnu_build_id.
99 (struct ld_state): Add build_id and buildidscnidx elements.
100 * ldgeneric.c: Implement --build-id command line parameter.
101 * ldlex.l (ID): Recognize - as valid character after the first one.
102
Ulrich Drepper5530ec52008-01-29 10:42:07 +00001032008-01-29 Ulrich Drepper <drepper@redhat.com>
104
Ulrich Drepperb61c4cc2008-01-30 07:16:28 +0000105 * ld.c (replace_args): New function.
106 (main): Use it to rewrite old-style parameters.
107
Ulrich Dreppered9b6cb2008-01-30 06:33:33 +0000108 * elf32-i386.script: Add .gnu.hash section.
109 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
110 (fillin_special_symbol): Initialize st_size.
111 (sortfct_hashval): New function.
112 (create_gnu_hash): New function.
113 (create_hash): New function.
114 (ld_generic_create_outfile): Use the new functions to create the
115 hash tables.
116
Ulrich Drepper5530ec52008-01-29 10:42:07 +0000117 * elflint.c (check_gnu_hash): Fix index value printed in error message.
118
Ulrich Drepper0e864dd2008-01-25 00:18:42 +00001192008-01-24 Ulrich Drepper <drepper@redhat.com>
120
121 * elflint.c (check_group): Check that signature symbol for section
122 group is not an empty string.
123 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
124 section. Start implementation of --hash-style.
125 * i386_ld.c: Likewise.
126 * ld.c: Recognize --hash-style.
127 * ld.h (struct scninfo): Add comdat_group.
128 Add additional parameter to finalize_plt callback.
129
Ulrich Drepper5449a6b2008-01-22 15:49:39 +00001302008-01-22 Ulrich Drepper <drepper@redhat.com>
131
132 * ld.h (struct callbacks): Add initialize_gotplt.
133 (struct scnhead): Add scn_dot_gotplt.
134 (struct ld_state): Add gotpltscnidx.
135 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
136 (elf_i386_initialize_pltrel): Likewise.
137 (elf_i386_initialize_got): There is now a separate .got.plt, so
138 don't do the PLT-related work here. Initialize d_type.
139 (elf_i386_initialize_gotplt): New function.
140 (elf_i386_plt0): Use ud2a after indirect jump.
141 (elf_i386_pic_plt0_entry): Likewise.
142 (elf_i386_finalize_plt): Reference now .got.plt.
143 (elf_i386_count_relocations): For GOT entries which need no relocation
144 don't bump nrel_got.
145 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
146 handling for split .got/.got.plt.
147 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
148 * elf32-i386.script: Sort sections for security. There are no .got
149 input sections. Add .got.plt.
150 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
151 (ld_generic_create_outfile): Initialize .got.plt section.
152 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
153
Ulrich Drepperd9488292008-01-20 16:43:15 +00001542008-01-19 Ulrich Drepper <drepper@redhat.com>
155
156 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
157 symbols are not carried over into statically linked output files.
158 Add dummy entries for more TLS relocations.
159
160 * ld.c (options): Add long names for -( and -).
161
162 * ldgeneric.c (check_definition): For newly found definitions don't
163 mark section as used if symbol is absolute.
164 (extract_from_archive): Only assign archive sequence number the first
165 time the archive is handled. Update ld_state.last_archive_used
166 if any symbol was used. Remove nround variable.
167 (file_process2): When using symbol from an archive, update
168 ld_state.group_start_archive, ld_state.archives, and
169 ld_state.tailarchives.
170 (ld_generic_file_process): If group is not handled anymore, after
171 freeing ELF handles for the archives, clear ld_state.archives and
172 *nextp. Fix wrong logic in recognizing first iteration of group
173 loop. When clearing flags, also clear ld_state.group_start_archive.
174
Ulrich Drepper5eee1222008-01-11 10:12:18 +00001752008-01-11 Ulrich Drepper <drepper@redhat.com>
176
177 * objdump.c (show_disasm): Adjust disassembler format string for
178 removal of %e.
179
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00001802008-01-04 Roland McGrath <roland@redhat.com>
181
Roland McGrath059c83e2008-02-21 06:19:39 +0000182 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
183 a size greater than the items cover means multiple sets of items.
184 (handle_core_note): Update caller.
185
1862008-01-04 Roland McGrath <roland@redhat.com>
187
Ulrich Dreppere219f1c2008-01-09 05:49:49 +0000188 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
189
1902008-01-03 Roland McGrath <roland@redhat.com>
191
192 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
193
194 * elflint.c (check_dynamic): Remove duplicate initializer.
195
Ulrich Drepperad024af2008-01-02 17:42:52 +00001962008-01-02 Ulrich Drepper <drepper@redhat.com>
197
198 * addr2line.c: Update copyright year.
199 * ar.c: Likewise.
200 * elfcmp.c: Likewise.
201 * elflint.c: Likewise.
202 * findtextrel.c: Likewise.
203 * ld.c: Likewise.
204 * nm.c: Likewise.
205 * objdump.c: Likewise.
206 * ranlib.c: Likewise.
207 * readelf.c: Likewise.
208 * size.c: Likewise.
209 * strings.c: Likewise.
210 * strip.c: Likewise.
211 * unstrip.c: Likewise.
212
Ulrich Drepper3cbdd382008-01-02 17:44:39 +00002132007-12-30 Ulrich Drepper <drepper@redhat.com>
214
215 * objdump (show_disasm): Use %e after third parameter.
216
2172007-12-21 Ulrich Drepper <drepper@redhat.com>
218
219 * strip.c: Fix wrong parenthesis in a few branch predictions.
220 * strings.c: Likewise.
221
2222007-12-20 Ulrich Drepper <drepper@redhat.com>
223
224 * Makefile.am (DEFS): Add DEBUGPRED.
225 * addr2line.c: Include debugpred.h.
226 * ar.c: Likewise.
227 * elfcmp.c: Likewise.
228 * elflint.c: Likewise.
229 * findtextrel.c: Likewise.
230 * nm.c: Likewise.
231 * objdump.c: Likewise.
232 * ranlib.c: Likewise.
233 * readelf.c: Likewise.
234 * size.c: Likewise.
235 * strings.c: Likewise.
236 * strip.c: Likewise.
237 * unstrip.c: Likewise.
238 * debugpred.h: New file.
239
240 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
241 (handle_relocs_rela): Likewise.
242
243 * readelf.c: Add lots of likely/unlikely.
244
245 * elflint.c: Minor cleanups.
246
Roland McGrath1a2e8f42007-12-15 23:39:34 +00002472007-11-19 Roland McGrath <roland@redhat.com>
248
249 * readelf.c (print_ops): Handle all bad op codes gracefully.
250 Print their numbers instead of just ???.
251
Roland McGrath07a696e2007-11-09 22:44:26 +00002522007-11-09 Roland McGrath <roland@redhat.com>
253
254 * readelf.c (attr_callback): Handle DW_AT_data_location.
Roland McGrath1a2e8f42007-12-15 23:39:34 +0000255 Handle block forms to mean a DWARF expression for DW_AT_allocated,
256 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
257 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
258 DW_AT_upper_bound.
Roland McGrath07a696e2007-11-09 22:44:26 +0000259
Roland McGrathe4c22ea2007-10-23 13:07:39 +00002602007-10-20 Roland McGrath <roland@redhat.com>
261
262 * unstrip.c (options): Update -R description.
263 (struct symbol): Put symbol details a union with a size_t pointer
264 `duplicate'.
265 (compare_symbols_output): Use null ->name as marker for discard
266 symbols, not zero *->map.
267 (copy_elided_sections): Record forwarding pointers for discarded
268 duplicates and fill SYMNDX_MAP elements through them.
269
270 * readelf.c (process_file): Set offline_next_address to 0 at start.
271 (struct process_dwflmod_args): New type.
272 (process_dwflmod): Take args in it, pass fd to process_elf_file.
273 (process_file): Update caller; dup FD for passing to libdwfl.
274 (process_elf_file): Take new arg FD. For ET_REL file when
275 displaying data affected by libdwfl relocation, open a new Elf handle.
276
2772007-10-17 Roland McGrath <roland@redhat.com>
278
279 * readelf.c (print_debug_line_section): For invalid data inside a
280 unit with plausible length, keep printing at the next unit boundary.
281
282 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
283
2842007-10-16 Roland McGrath <roland@redhat.com>
285
286 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
287
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00002882007-10-15 Roland McGrath <roland@redhat.com>
289
290 * make-debug-archive.in: New file.
291 * Makefile.am (EXTRA_DIST): Add it.
292 (make-debug-archive): New target.
293 (bin_SCRIPTS, CLEANFILES): Add it.
294
2952007-10-10 Roland McGrath <roland@redhat.com>
296
297 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
298 Use it to check MERGE|STRINGS for .debug_str.
299 (check_sections): Handle exact_or_gnuld.
300
3012007-10-08 Roland McGrath <roland@redhat.com>
302
303 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
304 64-bit struct timeval with 32-bit tv_usec.
305
3062007-10-07 Roland McGrath <roland@redhat.com>
307
308 * readelf.c (check_archive_index): New function.
309 (process_file): Call it. Change signature to take only fd and name.
310 Use libdwfl to open the file, then iterate on its modules (multiple
311 for an archive) to print file name and call process_elf_file.
312 (main): Update caller. Let process_file do elf_begin.
313 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
314 (process_elf_file): Take only Dwfl_Module * argument.
315 Don't print the file name here.
316 (print_debug_*_section): Take Dwfl_Module * argument.
317 (print_debug): Likewise. Update caller.
318 (format_dwarf_addr): New function.
319 (print_debug_ranges_section): Use it.
320 (attr_callback): Likewise.
321 (print_debug_line_section, print_debug_loc_section): Likewise.
322
323 * readelf.c (print_debug_ranges_section): Translate all strings.
324 (print_debug_loc_section): Likewise.
325
326 * unstrip.c (copy_elided_sections): Initialize SEC.
327
328 * ar.c (do_oper_insert): Put trailing / on short names.
329
330 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
331
332 * arlib2.c (arlib_add_long_name): Adjust for header size.
333
334 * arlib.c (arlib_finalize): Pad long name table to keep size even.
335
336 * ar.c (do_oper_insert): Use write_retry for padding write.
337
338 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
339 Unconditionally set FOUND[CNT]->elf when setting ->mem.
340 (remember_long_name): New function.
341 (do_oper_insert): Call it. Correctly use length of basename,
342 not original name. Don't store long name twice for new member.
343
3442007-10-06 Roland McGrath <roland@redhat.com>
345
346 * elflint.c (check_note): Skip empty segment.
347 (check_note_section): Skip empty section.
348
349 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
350 (handle_output_dir_module, handle_implicit_modules): Pass it down.
351 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
352 (compare_alloc_sections): Take new arg REL, ignore address if true.
353 (compare_sections): Likewise, pass it down.
354 (compare_sections_rel, compare_sections_nonrel): New functions.
355 (find_alloc_sections_prelink, copy_elided_sections): Use them
356 instead of compare_sections.
357 (sections_match): New function, broken out of ...
358 (find_alloc_section): ... here.
359 (copy_elided_sections): Reorganize section match-up logic.
360 Use sections_match for SHF_ALLOC in ET_REL.
361 For ET_REL, let the nonzero sh_addr from the debug file dominate.
362
363 * unstrip.c (add_new_section_symbols): Take new arg REL.
364 When true, do not update section symbol values.
365 (collect_symbols): Likewise. Update section symbols with address
366 of chosen output section, not original section.
367 (check_symtab_section_symbols, copy_elided_sections): Update callers.
368
369 * unstrip.c (compare_alloc_sections): At the same address, preserve
370 original section order.
371
372 * elflint.c (special_sections): Don't require MERGE|STRINGS for
373 .debug_str, it didn't always have them with older tools.
374
375 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
376
3772007-10-05 Roland McGrath <roland@redhat.com>
378
379 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
380 ET_REL file.
381
382 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
383 SHN_UNDEF as "bad section". Use shndx value in messages.
384
385 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
386 for ".debug" so it matches as a prefix.
387 (IS_KNOWN_SPECIAL): New macro.
388 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
389 type even under -d, for a .debug* or .shstrtab section.
390
391 * readelf.c (print_ops): Use hex for address operand.
392
3932007-10-04 Roland McGrath <roland@redhat.com>
394
395 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
396 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
397 sections mapped to SHN_UNDEF.
398
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00003992007-10-04 Ulrich Drepper <drepper@redhat.com>
400
401 * readelf.c (dump_archive_index): Avoid warning about uninitialized
402 variable with older glibc versions.
403 Add some branch prediction.
404
Roland McGrath59ea7f32007-10-04 08:50:09 +00004052007-10-04 Roland McGrath <roland@redhat.com>
406
407 * readelf.c (print_archive_index): New variable.
408 (options, parse_opt): Accept -c/--archive-index to set it.
409 (dump_archive_index): New function.
410 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
411 Call dump_archive_index on archives if set.
412 (main): Update caller.
413 (any_control_option): Give it file scope, moved out of ...
414 (parse_opt): ... here.
415
4162007-10-03 Roland McGrath <roland@redhat.com>
417
418 * unstrip.c (struct arg_info): Add `list' flag.
419 (options, parse_opt): Grok -n/--list to set it.
420 (list_module): New function.
421 (handle_implicit_modules): Call it under -n.
422
423 * elflint.c (check_note_section): New function.
424 (check_sections): Call it for SHT_NOTE.
425
426 * readelf.c (handle_notes): Use sections when available.
427
428 * elflint.c (check_note_data): New function, broken out of ...
429 (check_note): ... here. Call it and elf_getdata_rawchunk.
430
431 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
432 Use elf_getdata_rawchunk and gelf_getauxv.
433 (handle_notes_data): New function, broken out of ...
434 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
435
Roland McGrath241ac022007-10-01 18:21:46 +00004362007-10-01 Roland McGrath <roland@redhat.com>
437
Roland McGrathac0a16c2007-10-01 18:50:35 +0000438 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
439
Roland McGrath241ac022007-10-01 18:21:46 +0000440 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
441
Roland McGrathc76f0b02007-09-27 07:31:33 +00004422007-09-10 Roland McGrath <roland@redhat.com>
443
444 * readelf.c (options): Give -p optional argument, alias --string-dump.
445 (string_sections, string_sections_tail): New static variables.
446 (parse_opt): Set them when -p has an argument.
447 (print_string_section): New function, broken out of ...
448 (print_strings): ... here. Call it.
449 (dump_data_section): New function, broken out of ...
450 (dump_data): ... here. Call it.
451 (for_each_section_argument): New function, broken out of ...
452 (dump_data): ... here. Call it.
453 (dump_strings): New function.
454
4552007-08-31 Roland McGrath <roland@redhat.com>
456
457 * readelf.c (print_strings): Typo fix.
458
Roland McGrathcb6d8652007-08-23 08:10:54 +00004592007-08-23 Roland McGrath <roland@redhat.com>
460
461 * readelf.c (printf_with_wrap): Function removed.
462 (REGISTER_WRAP_COLUMN): New macro.
463 (handle_core_register): Use print_core_item instead.
464 (struct register_info): New type.
465 (compare_registers, compare_register_sets): New functions.
466 (register_bitpos, compare_sets_by_info): New functions.
467 (handle_core_registers): Use those to segregate and sort registers
468 for display.
469
470 * readelf.c (ITEM_WRAP_COLUMN): New macro.
471 (print_core_item): New function.
472 (handle_core_item): Use it instead of printf_with_wrap.
473 (compare_core_items, compare_core_item_groups): New functions.
474 (handle_core_items): Use them. Sort by group and force line breaks
475 between groups.
476
477 * readelf.c (handle_core_registers, handle_core_items): New functions,
478 broken out of ...
479 (handle_core_note): ... here. Call them.
480
4812007-08-22 Roland McGrath <roland@redhat.com>
482
483 * unstrip.c (new_shstrtab): New function, broken out of ...
484 (copy_elided_sections): ... here.
485
4862007-08-20 Roland McGrath <roland@redhat.com>
487
488 Avoid local function trampolines in nm binary.
489 * nm.c (sort_by_address): Move to a static function instead of local
490 inside show_symbols.
491 (sort_by_name_strtab): New static variable.
492 (sort_by_name): Use it. Move to a static function instead of local
493 inside show_symbols.
494 (show_symbols): Set sort_by_name_strtab.
495
4962007-08-19 Roland McGrath <roland@redhat.com>
497
498 * readelf.c (handle_auxv_note): New function.
499 (handle_notes): Call it.
500
501 * readelf.c (printf_with_wrap, convert): New functions.
502 (handle_core_item, (handle_core_register): New functions.
503 (handle_notes): Call those with details from ebl_core_note.
504
Roland McGrath099dd522007-08-13 22:58:36 +00005052007-08-12 Roland McGrath <roland@redhat.com>
506
507 * elflint.c (check_note): Accept type 0 with name "Linux".
508
509 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
510
511 * elflint.c (section_flags_string): Return "none" for 0, not "".
512
Roland McGrathd8221722007-08-11 21:18:09 +00005132007-08-11 Roland McGrath <roland@redhat.com>
514
515 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
516
Ulrich Drepperc98bcc72007-08-04 17:06:14 +00005172007-08-04 Ulrich Drepper <drepper@redhat.com>
518
519 * readelf.c (hex_dump): Use isprint to determine whether to print
520 character itself or full stop character.
521 (dump_data): No need to check endp for NULL after strtol call.
522
Roland McGrath60fc84c2007-08-03 21:59:15 +00005232007-08-03 Roland McGrath <roland@redhat.com>
524
525 * readelf.c (print_string_sections): New variable.
526 (options, parse_opt): Handle --strings/-p to set it.
527 (print_strings): New function.
528 (process_elf_file): Call it under -p.
529
530 * readelf.c (options): Add hidden aliases --segments, --sections,
531 as taken by binutils readelf.
532
5332007-08-01 Roland McGrath <roland@redhat.com>
534
535 * readelf.c (dump_data_sections, dump_data_sections_tail):
536 New variables.
537 (options, parse_opt): Handle --hex-dump/-x, set them.
538 (hex_dump): New function.
539 (dump_data): New function, call it.
540 (process_elf_file): Call it.
541
5422007-07-25 Roland McGrath <roland@redhat.com>
543
544 * addr2line.c (show_symbols): New variable.
545 (print_addrsym): New function.
546 (handle_address): Call it.
547 (options, parse_opt): Handle -S/--symbols.
548
Ulrich Drepperb0243862007-06-06 00:09:36 +00005492007-06-05 Ulrich Drepper <drepper@redhat.com>
550
551 * addr2line.c: Update for latest autoconf header.
552 * ar.c: Likewise.
553 * elfcmp.c: Likewise.
554 * elflint.c: Likewise.
555 * findtextrel.c: Likewise.
556 * ld.c: Likewise.
557 * ldgeneric.c: Likewise.
558 * nm.c: Likewise.
559 * objdump.c: Likewise.
560 * ranlib.c: Likewise.
561 * readelf.c: Likewise.
562 * size.c: Likewise.
563 * strings.c: Likewise.
564 * strip.c: Likewise.
565 * unstrip.c: Likewise.
566
Roland McGrath9aa8ef72007-05-18 08:59:43 +00005672007-05-18 Roland McGrath <roland@redhat.com>
568
569 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
570 stripped file, so as not to duplicate a section copied in both.
571
572 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
573
5742007-05-17 Roland McGrath <roland@redhat.com>
575
576 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
577
578 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
579
580 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
581 call make_directories here.
582 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
583 (handle_dwfl_module): Likewise.
584 (handle_implicit_modules): Update callers.
585 (handle_output_dir_module): Likewise. Don't do make_directories here.
586
587 * unstrip.c (get_section_name): New function, broken out of ...
588 (copy_elided_sections): here. Update callers.
589 (find_alloc_section): Broken out of ...
590 (copy_elided_sections): ... here. Update caller.
591 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
592 update STT_SECTION symbols' st_value fields as a side effect.
593 (check_symtab_section_symbols): Update caller.
594 (add_new_section_symbols): Set st_value in symbols added.
595 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
596 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
597 from .bss to .dynbss.
598 (find_alloc_sections_prelink): New function. Associate debug file
599 allocated SHT_NOBITS shdrs with stripped moved by prelink via
600 .gnu.prelink_undo information.
601 (copy_elided_sections): Call it when we couldn't find every allocated
602 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
603 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
604 (handle_file): Update callers.
605
606 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
607 named ".comment".
608
609 * elflint.c (check_sections): Fix association of segments with
610 sections when p_memsz > p_filesz.
611
6122007-04-29 Roland McGrath <roland@redhat.com>
613
614 * addr2line.c (options, main): Tweak argp group settings to fix
615 usage output.
616
6172007-04-28 Roland McGrath <roland@redhat.com>
618
619 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
620 sizes to match sections adjusted in the stripped file.
621
Roland McGrath4be15242007-04-25 03:09:33 +00006222007-04-24 Roland McGrath <roland@redhat.com>
623
624 * elfcmp.c (OPT_HASH_INEXACT): New macro.
625 (hash_inexact): New variable.
626 (options, parse_opt): Add --hash-inexact option to set it.
627 (hash_content_equivalent): New function.
628 (main): Call it for differing SHT_HASH sections under --hash-inexact.
629
6302007-04-23 Roland McGrath <roland@redhat.com>
631
632 * unstrip.c: New file.
633 * Makefile.am (bin_PROGRAMS): Add it.
634 (unstrip_LDADD): New variable.
635
636 * strip.c (options): Allow --output for -o.
637
Ulrich Drepper8b383102007-02-16 00:31:57 +00006382007-02-15 Ulrich Drepper <drepper@redhat.com>
639
640 * readelf.c: Remove unused code. Add a few consts.
641
Ulrich Drepper903c1162007-02-15 19:40:37 +00006422007-02-15 Roland McGrath <roland@redhat.com>
643
644 * readelf.c (print_debug): Fix brainos in SHDR test.
645
Roland McGrathf82a1ec2007-02-06 04:47:44 +00006462007-02-05 Roland McGrath <roland@redhat.com>
647
648 * ar.c: Include <limits.h>, since we use LONG_MAX.
649
Ulrich Drepper0fe63532007-02-05 21:05:51 +00006502007-02-05 Ulrich Drepper <drepper@redhat.com>
651
Ulrich Drepper8b383102007-02-16 00:31:57 +0000652 * ar.c: Add ugly hack to work around gcc complaining that we
Ulrich Drepper93ab56f2007-02-05 22:12:41 +0000653 ignore fchown's return value.
654 (do_oper_insert): Handle error when writing padding.
655 * ranlib.c: Add fchown complain work around.
656
Ulrich Drepper0fe63532007-02-05 21:05:51 +0000657 * arlib.c: Make symtab a global variable. Change all users.
658 * arlib2.c: Likewise.
659 * ranlib.c: Likewise.
660 * ar.c: Likewise.
661 * arlib.h: Declare it.
662
Ulrich Drepperaa915fd2007-02-05 07:25:33 +00006632007-01-11 Roland McGrath <roland@redhat.com>
664
665 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
666 SHF_MASKPROC bits separately from generic sh_flags validation.
667
Ulrich Drepperce0bdb62007-02-05 07:13:52 +00006682007-02-04 Ulrich Drepper <drepper@redhat.com>
669
670 * ar.c: New file.
671 * arlib.c: New file.
672 * arlib2.c: New file.
673 * arlib.h: New file.
674 * Makefile (noinst_LIBRARIES): Add libar.
675 (libar_a_SOURCES): Define.
676 (ar_LDADD): Define.
677 (CFLAGS_ar): Define.
678 * ranlib.c: Change to use arlib.
679
680 * elflint.c (check_symtab): Work around GNU ld bug which omits
681 sections but not symbols in those sections.
682
Ulrich Drepperb770cf92007-01-10 21:02:34 +00006832007-01-10 Ulrich Drepper <drepper@redhat.com>
684
685 * addr2line.c: Update copyright year.
686 * elfcmp.c: Likewise.
687 * elflint.c: Likewise.
688 * findtextrel.c: Likewise.
689 * ld.c: Likewise.
690 * nm.c: Likewise.
691 * objdump.c: Likewise.
692 * ranlib.c: Likewise.
693 * readelf.c: Likewise.
694 * size.c: Likewise.
695 * strings.c: Likewise.
696 * strip.c: Likewise.
697
Ulrich Drepper7c0e79f2006-12-09 21:10:19 +00006982006-12-09 Ulrich Drepper <drepper@redhat.com>
699
700 * elflint.c (compare_hash_gnu_hash): New function. Report if the
701 two hash tables have different content (module expected omission
702 of undefined symbols).
703
Roland McGrath8190db62006-12-17 23:56:51 +00007042006-10-31 Roland McGrath <roland@redhat.com>
705
706 * elflint.c (check_program_header): Don't complain about
Ulrich Drepper56bc0b82006-12-18 22:38:08 +0000707 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
Roland McGrath8190db62006-12-17 23:56:51 +0000708
7092006-09-19 Jakub Jelinek <jakub@redhat.com>
710
711 * strip.c (process_file): Disallow -f on archives.
712
7132006-10-09 Roland McGrath <roland@redhat.com>
714
715 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
716
Roland McGrathc373d852006-10-10 00:25:21 +00007172006-08-29 Roland McGrath <roland@redhat.com>
718
719 * Makefile.am (MAINTAINERCLEANFILES): New variable.
720
721 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
722 Reported by Christian Aichinger <Greek0@gmx.net>.
723
724 * elflint.c (valid_e_machine): Add EM_ALPHA.
725 Reported by Christian Aichinger <Greek0@gmx.net>.
726
Ulrich Drepper231c5902006-08-08 22:00:11 +00007272006-08-08 Ulrich Drepper <drepper@redhat.com>
728
729 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
730 Keep track of which "high DT" entries are present.
731 Check that either old or GNU-style hash table is present.
732 If GNU-style hash table is used a symbol table is mandatory.
733 Check that if any prelink entry is present all of them are.
734 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
735 table if they don't refer to functions.
736
Roland McGrath858b1892006-07-17 08:41:15 +00007372006-07-17 Roland McGrath <roland@redhat.com>
738
739 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
740 (add_version): Likewise for argument.
741 (check_versym): Cast constant to GElf_Versym for comparison.
742
Roland McGrath4ec807e2006-07-13 03:59:46 +00007432006-07-12 Roland McGrath <roland@redhat.com>
744
745 * readelf.c (handle_gnu_hash): Add casts for machines where
746 Elf32_Word != unsigned int.
747
Ulrich Drepperdcf61602006-07-12 19:59:02 +00007482006-07-12 Ulrich Drepper <drepper@redhat.com>
749
750 * elflint.c (check_sysv_hash64): Fix printf format.
751
Ulrich Dreppercc415622006-07-12 19:42:23 +00007522006-07-11 Roland McGrath <roland@redhat.com>
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000753
Ulrich Dreppercc415622006-07-12 19:42:23 +0000754 * addr2line.c (options): English fix in -f doc string.
755
756 * addr2line.c (use_comp_dir): New variable.
757 (options, parse_opt): Grok -A/--absolute to set it.
758 (handle_address): If set, prepend dwfl_line_comp_dir results to
759 relative file names.
Ulrich Drepper8ae58142006-07-12 05:22:32 +0000760
Ulrich Drepper28ed8952006-07-07 03:43:47 +00007612006-07-06 Ulrich Drepper <drepper@redhat.com>
762
763 * elflint.c: Adjust for latest new hash table format.
764 * readelf.c: Likewise.
765
766 * elflint.c (check_versym): Ignore hidden bit when comparing version
767 numbers.
768
7692006-07-05 Ulrich Drepper <drepper@redhat.com>
770
771 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
772 discarded COMDAT symbols.
773
774 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
775 (elf_i386_create_relocations): Likewise.
776 * ld.h (struct symbol): Add local and hidden bits.
777 * ld.c (create_special_section_symbol): These synthsized symbols
778 are local and hidden.
779 * ldgeneric.c (file_process2): Check whether input file matches
780 the emulation.
781 (fillin_special_symbol): Create symbols as local and/or hidden
782 if requested.
783 (ld_generic_create_outfile): Make local copy of symbol.
784 Don't hide global, defined symbols in dynamic symbol table unless
785 requested. Synthetic symbols have no version information.
786
787 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
788 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
789
7902006-07-04 Ulrich Drepper <drepper@redhat.com>
791
792 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
793 testing.
794
7952006-07-03 Ulrich Drepper <drepper@redhat.com>
796
797 * elflint.c: Add testing of DT_GNU_HASH.
798 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
799
800 * Makefile.am: Add hacks to create dependency files for non-generic
801 linker.
802
Ulrich Drepper6ca46002006-06-12 22:40:23 +00008032006-06-12 Ulrich Drepper <drepper@redhat.com>
804
805 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
806 section if creating a DSO and no interpreter is given.
807 (ld_generic_create_outfile): Don't store reference to symbols in
808 discarded COMDAT groups. Don't create PHDR and INTERP program header
809 for DSO if no interpreter is specified.
Ulrich Drepper595d0e72006-06-12 23:25:17 +0000810 (create_verneed_data): Pretty printing.
811
Ulrich Drepper6ca46002006-06-12 22:40:23 +0000812 * ldscript.y (content): If a DSO is created don't set default
813 interpreter from linker script.
814
815 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
816 for symbols in discarded COMDAT groups.
817 (elf_i386_create_relocations): Likewise.
818 * ld.h (struct scninfo): Add unused_comdat.
819 * ldgeneric.c (add_section): Also check group signature when
820 matching COMDAT sections.
821 (add_relocatable_file): Ignore symbols in COMDAT group which are
822 discarded.
823
824 * elflint.c (check_one_reloc): For *_NONE relocs only check type
825 and symbol reference.
826
Ulrich Drepper54f33a72006-06-11 09:07:37 +00008272006-06-11 Ulrich Drepper <drepper@redhat.com>
828
Ulrich Dreppercbb51e52006-06-11 20:25:23 +0000829 * elflint.c (check_dynamic): Fix checking value of tags which are
830 offsets in the string section. Make sure DT_STRTAB points to the
831 section referenced in sh_link.
832
833 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
834
Ulrich Drepper54f33a72006-06-11 09:07:37 +0000835 * ld.c: Recognize --eh-frame-hdr option.
836 * ld.h (struct ld_state): Add eh_frame_hdr field.
837 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
838
839 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
840 SH_FLAGS_COMBINE.
841 (add_relocatable_file): Minor optimization of last change.
842 (match_section): Don't preserve SHF_GROUP flag any longer.
843
Ulrich Drepper2d880282006-06-11 00:20:43 +00008442006-06-10 Ulrich Drepper <drepper@redhat.com>
845
846 * ld.c (parse_z_option): Recognize execstack and noexecstack.
Ulrich Drepper4f0a7a82006-06-11 00:53:45 +0000847 Handle record and ignore as position dependent options.
848 (parse_z_option_2): Handle ignore and record here.
Ulrich Drepper2d880282006-06-11 00:20:43 +0000849 * ld.h (struct ld_state): Add execstack field.
850 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
851 sections.
852 (ld_generic_create_outfile): Fix program header creation in native
853 linker. Add PT_GNU_STACK program header.
854
Ulrich Dreppera688a732006-06-10 06:33:00 +00008552006-06-09 Ulrich Drepper <drepper@redhat.com>
856
857 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
858 for PLT entries if there is no local definition.
859
860 * ld.c (parse_option): Handle -z ignore like --as-needed and
861 -z record like --no-as-needed.
862 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
863 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
864 looping over DSOs. When deciding about adding DT_NEEDED entries
865 use ->as_needed instead of ignore_unused_dsos.
866
Ulrich Drepper8c56fe32006-05-31 15:50:43 +00008672006-05-31 Ulrich Drepper <drepper@redhat.com>
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000868
Ulrich Drepper8c56fe32006-05-31 15:50:43 +0000869 * ld.c: Recognize --as-needed and --no-as-needed options.
870 * ld.h (struct usedfile): Add as_needed field.
871 (struct ld_state): Likewise.
872 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
873 the list.
874 * ldscript.y (filename_id_list): Split to correctly parse all
875 combinations.
876 (mark_as_needed): Fix loop.
Ulrich Drepper11b030e2006-05-28 20:28:19 +0000877
Ulrich Drepper697f4db2006-06-10 06:50:47 +00008782006-05-28 Ulrich Drepper <drepper@redhat.com>
879
880 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
881 and colno.
882
Ulrich Drepper2cb8e732006-05-27 21:57:27 +00008832006-05-27 Ulrich Drepper <drepper@redhat.com>
884
885 * readelf.c (handle_relocs_rela): Better notations for addon value.
Ulrich Drepper41a99082006-05-28 00:01:43 +0000886 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
Ulrich Drepper2cb8e732006-05-27 21:57:27 +0000887
Ulrich Drepper82c345d2006-04-04 22:07:54 +00008882006-04-04 Ulrich Drepper <drepper@redhat.com>
889
890 * addr2line.c: Update copyright year.
891 * elfcmp.c: Likewise.
892 * elflint.c: Likewise.
893 * findtextrel.c: Likewise.
894 * ld.c: Likewise.
895 * nm.c: Likewise.
896 * objdump.c: Likewise.
897 * ranlib.c: Likewise.
898 * readelf.c: Likewise.
899 * size.c: Likewise.
900 * strings.c: Likewise.
901 * strip.c: Likewise.
902
Roland McGrathdd7e22b2006-03-09 23:05:47 +00009032006-03-09 Roland McGrath <roland@redhat.com>
904
905 * Makefile.am (AM_LDFLAGS): New variable.
906
Roland McGrath060fa052006-03-02 07:51:50 +00009072006-03-01 Roland McGrath <roland@redhat.com>
908
909 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
910 for dwarf.h changes matching 3.0 spec.
911 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
912
Ulrich Drepper038129b2005-12-04 16:47:24 +00009132005-12-04 Ulrich Drepper <drepper@redhat.com>
914
915 * elflint.c (check_one_reloc): If relocation section is not loaded,
916 don't check whether the relocations modify read-only sections or
917 loaded and unloaded sections.
918
Ulrich Drepper607e0542005-12-04 15:51:06 +00009192005-11-28 Ulrich Drepper <drepper@redhat.com>
920
921 * elflint.c (check_one_reloc): Take additional parameters. Use
922 them to determine whether relocation is valid in this type of
923 file. DSOs and executables can contain relocation sections in
924 unloaded sections which just show the relocations the linker
925 applied. Adjust all callers.
926 (check_program_header): Check that PT_PHDR is loaded and that offset
927 matches the one in the ELF header.
928
Roland McGrath6724c902005-10-28 07:07:19 +00009292005-10-26 Roland McGrath <roland@redhat.com>
930
931 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
932
Ulrich Drepperd0449522005-09-03 07:23:52 +00009332005-09-03 Ulrich Drepper <drepper@redhat.com>
934
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000935 * strip.c (handle_elf): Unify some error messages.
936 * ld.c (main): Likewise.
937 * ldgeneric.c (open_elf): Likewise.
938 * elfcmp.c (main): Likewise.
939 * elflint.c (check_elf_header): Likewise.
940
941 * size.c (process_file): Fix typo in error message.
942
Ulrich Drepperd0449522005-09-03 07:23:52 +0000943 * readelf.c: Lots of little cleanups. Use _unlocked functions.
944
Ulrich Dreppera60501e2005-09-02 19:50:17 +00009452005-09-02 Ulrich Drepper <drepper@redhat.com>
946
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +0000947 * strings.c (main): Reset elfmap variable after munmap call.
Ulrich Drepper618795f2005-09-02 20:01:37 +0000948 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
Ulrich Dreppera60501e2005-09-02 19:50:17 +0000949
Ulrich Drepperfbe998a2005-08-29 16:27:10 +00009502005-08-28 Ulrich Drepper <drepper@redhat.com>
951
952 * ranlib.c: Don't define pread_retry and write_retry here.
953
954 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
955 (CLEANFILES): Add *.gcno *.gcda *.gconv.
956
957 * strings.c (process_chunk): Reorder expressions in conditional
958 (process_chunk_mb): Likewise.
959
960 * strings.c: New file.
961 * Makefile.am (bin_PROGRAMS): Add strings.
962 (strings_no_Wstring): Define.
963 (strings_LDADD): Define.
964
Roland McGrath71e15a02005-08-27 10:33:26 +00009652005-08-27 Roland McGrath <roland@redhat.com>
966
967 * addr2line.c (dwarf_diename_integrate): Function removed.
968 (print_dwarf_function): Use plain dwarf_diename.
969
Ulrich Drepperc5a06cd2005-08-24 19:50:14 +00009702005-08-24 Ulrich Drepper <drepper@redhat.com>
971
972 * elflint.c (check_versym): Versioned symbols should not have
973 local binding.
974
Ulrich Drepper5d832292005-08-15 21:36:27 +00009752005-08-15 Ulrich Drepper <drepper@redhat.com>
976
Ulrich Drepper61655e02005-08-16 04:23:02 +0000977 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
978 undefined.
979
Ulrich Drepper5d832292005-08-15 21:36:27 +0000980 * Makefile.am: Add rules to build ranlib.
981 * ranlib.c: New file.
982
Roland McGrath18e13422005-08-15 08:01:25 +00009832005-08-14 Roland McGrath <roland@redhat.com>
984
985 * elflint.c (check_sections): Use ebl_section_type_name and allow any
986 sh_type it recognizes.
987
988 * elflint.c (check_sections): Print unknown flags in hex, don't
989 truncate high bits. Print section number and name for unknown type.
990
Roland McGrathf6895042005-08-13 20:56:52 +00009912005-08-13 Roland McGrath <roland@redhat.com>
992
993 * elflint.c (check_program_header): Use ebl_segment_type_name and
994 allow any p_type it recognizes. Include p_type value in error
995 message for unknown type.
996
Ulrich Drepperc5c33a62005-08-13 17:50:47 +00009972005-08-13 Ulrich Drepper <drepper@redhat.com>
998
999 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
1000 to ebl_check_special_symbol.
1001 (check_sections): Pass ehdr to ebl_bss_plt_p.
1002
Roland McGrath653d3762005-08-13 01:59:10 +000010032005-08-12 Roland McGrath <roland@redhat.com>
1004
1005 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
1006 refers to the right section if it's not SHN_ABS.
1007 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
1008
1009 * elflint.c (check_sections): Don't complain about a non-NOBITS
1010 section taking no segment space, if it's sh_size is 0.
1011
1012 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
1013 be PROGBITS or NOBITS.
1014
1015 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
1016 standard st_value and st_size checks.
1017
Roland McGrath1c83bf12005-08-11 07:03:55 +000010182005-07-28 Roland McGrath <roland@redhat.com>
Ulrich Drepperfaf4d192005-08-11 05:12:05 +00001019
Roland McGrath1c83bf12005-08-11 07:03:55 +00001020 * addr2line.c (options, parse_opt): Don't handle -e here.
1021 (executable): Variable removed.
1022 (argp_children): New static variable.
1023 (argp): Use it. Make const.
1024 (main): Fill in argp_children from dwfl_standard_argp ().
1025 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1026 (print_dwarf_function): New function. Try to figure out inline chain.
1027 (elf_getname): Function removed, libdwfl does it for us.
1028 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1029 Use dwfl_module_addrname instead of elf_getname.
1030 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1031 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1032
10332005-08-10 Ulrich Drepper <drepper@redhat.com>
1034
1035 * strip.c (parse_opt): STATE parameter is now used.
1036 Various little cleanups.
1037
1038 * readelf.c (print_debug_line_section): Correct fallout of renaming
1039 of DW_LNS_set_epilog_begin.
Ulrich Drepper6d5c3bd2005-08-11 04:37:52 +00001040
Roland McGrath8f31c2c2005-08-09 04:58:05 +000010412005-08-08 Roland McGrath <roland@redhat.com>
1042
1043 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1044 with binutils strip. Likewise -d, -S, as aliases for -g.
1045 Likewise ignore -s/--strip-all.
1046
Roland McGrath095a01b2005-08-08 03:49:35 +000010472005-08-07 Roland McGrath <roland@redhat.com>
1048
1049 * strip.c (process_file): Open read-only when using a different output
1050 file.
1051
Ulrich Drepper47be7952005-08-07 04:41:39 +000010522005-08-06 Ulrich Drepper <drepper@redhat.com>
1053
Ulrich Drepper637963b2005-08-07 05:33:07 +00001054 * elflint.c (in_nobits_scn): New function.
1055 (check_versym): Allow references for defined symbols against versions
1056 of other DSOs also for symbols in nobits sections.
1057 Move a few variables around.
1058
Ulrich Drepper47be7952005-08-07 04:41:39 +00001059 * Makefile.am (AM_CFLAGS): Avoid duplication.
1060 Link with statis libs if BUILD_STATIC.
1061
Ulrich Drepperdbace232005-08-06 01:37:23 +000010622005-08-05 Ulrich Drepper <drepper@redhat.com>
1063
1064 * elflint.c: Many, many more tests. Mostly related to symbol
1065 versioning. Those sections should now be completely checked.
1066
1067 * readelf.c (print_dynamic): Use gelf_offscn.
1068
Ulrich Drepperacb89832005-08-04 07:01:49 +000010692005-08-04 Ulrich Drepper <drepper@redhat.com>
1070
1071 * elflint.c: Add lots more tests: more extension symbol table sanity,
1072 versioning section tests, hash table tests. General cleanup.
1073
Ulrich Drepperc911c9e2005-08-02 16:07:42 +000010742005-08-02 Ulrich Drepper <drepper@redhat.com>
1075
Ulrich Drepper8a687742005-08-03 02:24:12 +00001076 * objdump.c: New file.
1077 * Makefile.am (bin_PROGRAMS): Add objdump.
1078 (objdump_LDADD): Define.
1079
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001080 * elflint.c (check_reloc_shdr): New function split out from check_rela
1081 and check_rel.
1082 (check_one_reloc): New function. Likewise.
1083 (check_rela): Use check_reloc_shdr and check_one_reloc.
1084 (check_rel): Likewise.
Ulrich Drepper41de4882005-08-03 00:02:56 +00001085 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
1086 section.
1087 Add checks that relocations against read-only segments are flagged,
1088 that the text relocation flag is not set unnecessarily, and that
1089 relocations in one section are either against loaded or not-loaded
1090 segments.
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001091
Ulrich Drepper8533dcf2005-08-01 07:18:47 +000010922005-08-01 Ulrich Drepper <drepper@redhat.com>
1093
1094 * elfcmp.c (main): Ignore section count and section name string table
1095 section index.
1096
Roland McGrathf9ece8a2005-07-28 07:03:04 +000010972005-07-27 Roland McGrath <roland@redhat.com>
1098
1099 * elfcmp.c: Include <locale.h>.
1100
Ulrich Drepper7d48d6a2005-07-27 10:13:23 +000011012005-07-27 Ulrich Drepper <drepper@redhat.com>
1102
1103 * elfcmp.c: Print name and index of differing section.
1104
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000011052005-07-24 Ulrich Drepper <drepper@redhat.com>
1106
1107 * elfcmp.c: Implement comparing gaps between sections.
1108
11092005-07-23 Ulrich Drepper <drepper@redhat.com>
1110
1111 * elflint.c: Include libeblP.h instead of libebl.h.
1112 * nm.c: Likewise.
1113 * readelf.c: Likewise.
1114 * elfcmp.c: Likewise.
1115
1116 * elfcmp.c (main): Compare individual ELF header fields, excluding
1117 e_shoff instead of the whole struct at once.
1118 Use ebl_section_strip_p instead of SECTION_STRIP_P.
1119 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
1120
11212005-07-22 Ulrich Drepper <drepper@redhat.com>
1122
1123 * elfcmp.c (main): Take empty section into account when comparing
1124 section content.
1125
1126 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
1127 using it.
1128
11292005-07-21 Ulrich Drepper <drepper@redhat.com>
1130
1131 * elfcmp.c: New file.
1132 * Makefile.am (bin_PROGRAMS): Add elfcmp.
1133 (elfcmp_LDADD): Define.
1134
1135 * elflint.c (check_rela): Check that copy relocations only reference
1136 object symbols or symbols with unknown type.
1137 (check_rel): Likewise.
1138
11392005-06-08 Roland McGrath <roland@redhat.com>
1140
1141 * readelf.c (print_ops): Add consts.
1142
11432005-05-31 Roland McGrath <roland@redhat.com>
1144
1145 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
1146 abbreviations. Print a header line before each CU section.
1147
1148 * readelf.c (print_debug_loc_section): Fix indentation for larger
1149 address size.
1150
11512005-05-30 Roland McGrath <roland@redhat.com>
1152
1153 * readelf.c (print_debug_line_section): Print section offset of each
1154 CU's table, so they are easy to find from seeing the stmt_list value.
1155
1156 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
1157 (attr_callback): Grok DW_AT_ranges and print offset in hex.
1158
1159 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
1160 (print_debug_ranges_section, print_debug_loc_section): Likewise.
1161
1162 * readelf.c (print_ops): Take different args for indentation control.
1163 (attr_callback): Caller updated.
1164 Grok several more block-form attributes as being location expressions.
1165 For those same attributes with udata forms, format output differently
1166 for location list offset.
1167 (print_debug_loc_section): Implement it for real.
1168
1169 * readelf.c (options): Mention ranges for --debug-dump.
1170 (enum section_e): Add section_ranges.
1171 (parse_opt): Grok "ranges" for -w/--debug-dump.
1172 (print_debug_ranges_section): New function.
1173 (print_debug): Handle .debug_ranges section.
1174
11752005-05-30 Ulrich Drepper <drepper@redhat.com>
1176
1177 * readelf.c (handle_notes): At least x86-64 need not have the note
1178 section values aligned to 8 bytes.
1179
11802005-05-18 Ulrich Drepper <drepper@redhat.com>
1181
1182 * readelf.c (dwarf_tag_string): Add new tags.
1183
11842005-05-08 Roland McGrath <roland@redhat.com>
1185
1186 * strip.c (handle_elf): Don't translate hash and versym data formats,
1187 elf_getdata already did it for us.
1188
11892005-05-07 Ulrich Drepper <drepper@redhat.com>
1190
1191 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
1192 (addr2line_LDADD): Likewise.
1193
11942005-05-03 Roland McGrath <roland@redhat.com>
1195
1196 * strip.c (handle_elf): Apply symbol table fixups to discarded
1197 relocation sections when they are being saved in the debug file.
1198
1199 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
1200 and gelf_xlatetof, not the native byte order.
1201
1202 * strip.c (parse_opt): Give error if -f or -o is repeated.
1203 (main): Exit if argp_parse returns nonzero.
1204
1205 * strip.c (debug_fname_embed): New variable.
1206 (options, parse_opt): New option -F to set it.
1207
12082005-05-07 Ulrich Drepper <drepper@redhat.com>
1209
1210 * readelf.c (parse_opt): Make any_control_option variable
1211 local. Simplify some tests.
1212
12132005-05-03 Roland McGrath <roland@redhat.com>
1214
1215 * strip.c (crc32_file): Function removed (now in ../lib).
1216
12172005-05-03 Roland McGrath <roland@redhat.com>
1218
1219 * elflint.c (is_debuginfo): New variable.
1220 (options, parse_opt): New option --debuginfo/-d to set it.
1221 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
1222 (check_note): If is_debuginfo, don't try to get note contents.
1223
12242005-04-24 Ulrich Drepper <drepper@redhat.com>
1225
1226 * readelf.c (print_debug_abbrev_section): Don't print error when end of
1227 section reached.
1228
12292005-04-14 Ulrich Drepper <drepper@redhat.com>
1230
1231 * readelf.c (dwarf_encoding_string): New function.
1232 (dwarf_inline_string): New function.
1233 (dwarf_access_string): New function.
1234 (dwarf_visibility_string): New function.
1235 (dwarf_virtuality_string): New function.
1236 (dwarf_identifier_case_string): New function.
1237 (dwarf_calling_convention_string): New function.
1238 (dwarf_ordering_string): New function.
1239 (dwarf_discr_list_string): New function.
1240 (attr_callback): Decode man more attribute values.
1241
12422005-04-01 Ulrich Drepper <drepper@redhat.com>
1243
1244 * addr2line.c: Finish implementation of -f option.
1245
12462005-03-29 Ulrich Drepper <drepper@redhat.com>
1247
1248 * addr2line.c: New file.
1249 * Makefile.am (bin_PROGRAMS): Add addr2line.
1250 Define addr2line_LDADD.
1251
1252 * findtextrel.c: Use new dwarf_addrdie function.
1253
1254 * findtextrel.c: Fix usage message and re-add accidentally removed
1255 line.
1256
12572005-03-28 Ulrich Drepper <drepper@redhat.com>
1258
1259 * findtextrel.c: New file.
1260 * Makefile: Add rules to build findtextrel.
1261
12622005-02-15 Ulrich Drepper <drepper@redhat.com>
1263
1264 * ldlex.l: Provide ECHO definition to avoid warning.
1265
1266 * elflint.c (check_program_header): Fix typo in RELRO test.
1267
1268 * Makefile.am (AM_CFLAGS): Add more warning options.
1269 * elflint.c: Fix warnings introduced by the new warning options.
1270 * i386_ld.c: Likewise.
1271 * ld.c: Likewise.
1272 * ld.h: Likewise.
1273 * ldgeneric.c: Likewise.
1274 * nm.c: Likewise.
1275 * readelf.c: Likewise.
1276 * sectionhash.c: Likewise.
1277 * size.c: Likewise.
1278 * string.c: Likewise.
1279
12802005-02-05 Ulrich Drepper <drepper@redhat.com>
1281
1282 * Makefile.am: Check for text relocations in constructed DSOs.
1283
1284 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
1285 with -lmudflap.
1286
1287 * ldscript.y: Add as_needed handling.
1288 * ldlex.l: Recognize AS_NEEDED token.
1289 * ld.h (struct filename_list): Add as_needed flag.
1290
12912005-02-04 Ulrich Drepper <drepper@redhat.com>
1292
1293 * elflint.c (check_symtab): Correctly determine size of GOT section.
1294
12952005-01-19 Ulrich Drepper <drepper@redhat.com>
1296
1297 * ld.c: Remove unnecessary more_help function. Print bug report
1298 address using argp.
1299 * strip.c: Likewise.
1300 * size.c: Likewise.
1301 * nm.c: Likewise.
1302 * readelf.c: Likewise.
1303 * elflint.c: Likewise.
1304
1305 * elflint.c (main): Don't check for parameter problems here.
1306 (parse_opt): Do it here, where we get informed about some of them
1307 anyway.
1308
1309 * readelf.c (main): Don't check for parameter problems here.
1310 (parse_opt): Do it here, where we get informed about some of them
1311 anyway.
1312
13132005-01-11 Ulrich Drepper <drepper@redhat.com>
1314
1315 * strip.c: Update copyright year.
1316 * readelf.c: Likewise.
1317 * size.c: Likewise.
1318 * nm.c: Likewise.
1319 * ld.c: Likewise.
1320 * elflint.c: Likewise.
1321
1322 * elflint.c (check_symtab): Don't warn about wrong size for
1323 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
1324
13252004-10-05 Ulrich Drepper <drepper@redhat.com>
1326
1327 * readelf.c (print_phdr): In section mapping, also indicate
1328 sections in read-only segments.
1329
13302004-09-25 Ulrich Drepper <drepper@redhat.com>
1331
1332 * readelf.c: Make compile with gcc 4.0.
1333 * strip.c: Likewise.
1334
13352004-08-16 Ulrich Drepper <drepper@redhat.com>
1336
1337 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
1338 allocate to work around gcc 3.4 bug.
1339
13402004-01-25 Ulrich Drepper <drepper@redhat.com>
1341
1342 * ldlex.l (invalid_char): Better error message.
1343
13442004-01-23 Ulrich Drepper <drepper@redhat.com>
1345
1346 * readelf.c: Print SHT_GNU_LIBLIST sections.
1347
1348 * none_ld.c: New file.
1349
13502004-01-21 Ulrich Drepper <drepper@redhat.com>
1351
1352 * Makefile.am: Enable building of machine specific linker.
1353
13542004-01-20 Ulrich Drepper <drepper@redhat.com>
1355
1356 * Makefile.am: Support building with mudflap.
1357
1358 * i386_ld.c: Fix warnings gcc 3.4 spits out.
1359 * ldgeneric.c: Likewise.
1360 * ldscript.y: Likewise.
1361 * readelf.c: Likewise.
1362 * strip.c: Likewise.
1363
1364 * readelf.c (print_debug_line_section): Determine address size
1365 correctly.
1366
13672004-01-19 Ulrich Drepper <drepper@redhat.com>
1368
1369 * readelf.c (print_phdr): Show which sections are covered by the
1370 PT_GNU_RELRO entry.
1371
1372 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
1373
1374 * readelf.c (print_debug_macinfo_section): Implement.
1375
13762004-01-18 Ulrich Drepper <drepper@redhat.com>
1377
1378 * readelf.c (print_debug_line_section): Implement.
1379
13802004-01-17 Ulrich Drepper <drepper@redhat.com>
1381
1382 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
1383 * src/ld.c: Likewise.
1384 * src/nm.c: Likewise.
1385 * src/readelf.c: Likewise.
1386 * src/size.c: Likewise.
1387 * src/strip.c: Likewise.
1388
1389 * strip.c: Add a few more unlikely. Reduce scope of some variables.
1390
1391 * Makefile.am: Support building with mudflap.
1392
13932004-01-16 Ulrich Drepper <drepper@redhat.com>
1394
1395 * readelf.c (print_debug_info_section): Free dies memory.
1396
1397 * readelf.c: Print .debug_info section content.
1398
13992004-01-13 Ulrich Drepper <drepper@redhat.com>
1400
1401 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
1402
14032004-01-12 Ulrich Drepper <drepper@redhat.com>
1404
1405 * readelf.c (print_debug_aranges): Implement using libdw.
1406
14072004-01-11 Ulrich Drepper <drepper@redhat.com>
1408
1409 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
1410
1411 * readelf.c: Use libdw instead of libdwarf. Not all of the old
1412 behavior is available yet.
1413 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
1414
14152004-01-09 Ulrich Drepper <drepper@redhat.com>
1416
1417 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
1418
1419 * nm.c: Implement getting information about local variables.
1420
14212004-01-07 Ulrich Drepper <drepper@redhat.com>
1422
1423 * nm.c: Read also debug information for local symbols.
1424
14252004-01-05 Ulrich Drepper <drepper@redhat.com>
1426
1427 * nm.c: Shuffle dwarf handling code around so the maximum column
1428 width can be computed ahead of printing. Avoid collection symbols
1429 which are not printed anyway.
1430
1431 * nm.c: Rewrite dwarf handling to use libdw.
1432 * Makefile.am (AM_CFLAGS): Add -std parameter.
1433 (INCLUDES): Find header in libdw subdir.
1434 (nm_LDADD): Replace libdwarf with libdw.
1435
1436 * elflint.c: Update copyright year.
1437 * readelf.c: Likewise.
1438 * size.c: Likewise.
1439 * strip.c: Likewise.
1440 * nm.c: Likewise.
1441
14422003-12-31 Ulrich Drepper <drepper@redhat.com>
1443
1444 * strip.c (process_file): Close file before returning.
1445
14462003-11-19 Ulrich Drepper <drepper@redhat.com>
1447
1448 * readelf.c (handle_dynamic): Make column for tag name wider.
1449
14502003-09-29 Ulrich Drepper <drepper@redhat.com>
1451
1452 * readelf.c (handle_dynamic): Always terminate tag name with a space.
1453
14542003-09-25 Ulrich Drepper <drepper@redhat.com>
1455
1456 * strip.c (process_file): Don't mmap the input file, we modify the
1457 data structures and don't want the change end up on disk.
1458
14592003-09-23 Jakub Jelinek <jakub@redhat.com>
1460
1461 * unaligned.h (union u_2ubyte_unaligned,
1462 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
1463 packed attribute.
1464 (add_2ubyte_unaligned, add_4ubyte_unaligned,
1465 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
1466 Read/store value through _ptr->u instead of *_ptr.
1467
14682003-09-22 Ulrich Drepper <drepper@redhat.com>
1469
1470 * size.c (show_sysv): Change type of maxlen to int.
1471
1472 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
1473 buckets.
1474
1475 * i386_ld.c: Many many fixes and extensions.
1476 * ld.c: Likewise.
1477 * ldgeneric.c: Likewise.
1478
14792003-08-16 Ulrich Drepper <drepper@redhat.com>
1480
1481 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
1482 the reference is from another DSO.
1483
14842003-08-15 Ulrich Drepper <drepper@redhat.com>
1485
1486 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
1487 point is found when creating a DSO.
1488
14892003-08-14 Ulrich Drepper <drepper@redhat.com>
1490
1491 * ld.c (main): Always call FLAG_UNRESOLVED.
1492 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
1493 undefined symbols if not creating DSO or ld_state.nodefs is not set.
1494
14952003-08-13 Ulrich Drepper <drepper@redhat.com>
1496
1497 * Makefile.in: Depend on libebl.a, not libebl.so.
1498
1499 * ld.c (main): Mark stream for linker script as locked by caller.
1500 (read_version_script): Likewise.
1501 * ldlex.c: Define fread and fwrite to _unlocked variant.
1502
1503 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
1504 target_bswap_32.
1505 * unaligned.h: Define target_bswap_16, target_bswap_32, and
1506 target_bswap_64.
1507 (store_2ubyte_unaligned, store_4ubyte_unaligned,
1508 store_8ubyte_unaligned): Define using new macros.
1509
15102003-08-12 Ulrich Drepper <drepper@redhat.com>
1511
1512 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
1513 possibly unaligned memory. Support use of big endian machines.
1514
15152003-08-11 Ulrich Drepper <drepper@redhat.com>
1516
1517 * Moved to CVS archive.