blob: c03f0b455b946ff2ce4561b4adbf338a07d8bbaa [file] [log] [blame]
Roland McGrathe4061d02010-01-04 20:25:09 -080012010-01-04 Roland McGrath <roland@redhat.com>
2
Roland McGrath2e79deb2010-01-04 20:36:10 -08003 * readelf.c (implicit_debug_sections): New variable.
4 (parse_opt): Set it instead of print_debug_sections for -a.
5 OR them together for print_debug check.
6 (print_debug): OR them together for section check.
7
Roland McGratha7422be2010-01-04 20:29:33 -08008 * readelf.c (options): Repartition into set implied by -a and others.
9 Correct -a text to match reality.
10
Roland McGrathe4061d02010-01-04 20:25:09 -080011 * readelf.c (struct section_argument): Add bool member 'implicit'.
12 (parse_opt): Set it for -a cases, clear it for -x args.
13 (for_each_section_argument): Don't complain about a missing section by
14 name if it's implicit.
15
Roland McGrathefa64962009-11-16 01:50:58 -0800162009-11-16 Roland McGrath <roland@redhat.com>
17
18 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
19 sections, just as dump_data_section already does.
20
Mark Wielaardc49d00a2009-09-21 16:47:07 -0700212009-09-21 Ulrich Drepper <drepper@redhat.com>
22
23 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
24 set for .comment section.
25 Patch by Mark Wielaard <mjw@redhat.com>.
26
Roland McGrathfb33c672009-09-08 00:21:18 -0700272009-09-08 Roland McGrath <roland@redhat.com>
28
29 * ar.c (main): Fix typo in message format.
30
Roland McGrath2d13ea22009-08-21 03:16:32 -0700312009-08-21 Roland McGrath <roland@redhat.com>
32
33 * readelf.c (attr_callback): Use print_block only when we don't use
34 print_ops.
35
Roland McGrath536127f2009-08-14 13:10:09 -0700362009-08-14 Roland McGrath <roland@redhat.com>
37
38 * ar.c (do_oper_extract): Use pathconf instead of statfs.
39
Ulrich Drepper9ccf76a2009-08-01 10:07:24 -0700402009-08-01 Ulrich Drepper <drepper@redhat.com>
41
42 * debugpred.h: Add two most const.
43
Mark Wielaardbc1b92e2009-07-26 08:33:18 -0700442009-07-26 Mark Wielaard <mjw@redhat.com>
45
46 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
47
Mark Wielaard79178202009-07-25 12:44:46 -0700482009-07-25 Mark Wielaard <mjw@redhat.com>
49
50 * Makefile.am (addr2line_LDADD): Add $(libelf).
51
Roland McGrathbe4589d2009-07-24 16:23:12 -0700522009-07-24 Roland McGrath <roland@redhat.com>
53
54 * readelf.c (print_block): New function.
55 (print_ops): Use it.
56 (attr_callback): Use it for DW_FORM_block* forms.
57
Mark Wielaarddaf85b22009-07-24 15:49:51 -0700582009-07-20 Mark Wielaard <mjw@redhat.com>
59
60 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
61 and DW_OP_stack_value.
62
Ulrich Drepper96d950e2009-07-14 10:42:01 -0700632009-07-14 Ulrich Drepper <drepper@redhat.com>
64
65 * elflint.c (check_elf_header): Allow Linux ABI.
66 (check_symtab): Handle STB_GNU_UNIQUE.
67
Mark Wielaardf735db12009-07-08 19:18:53 +0200682009-07-08 Mark Wielaard <mjw@redhat.com>
69
70 * readelf.c (attr_callback): Handle DW_Form constants for
71 DW_AT_data_member_location.
72
Roland McGrathdffc33d2009-07-06 16:06:41 -0700732009-07-06 Roland McGrath <roland@redhat.com>
74
75 * readelf.c (register_info): New function. Handle unknown register #s.
76 (print_cfa_program): Use it.
77 (handle_core_register, handle_core_registers): Likewise.
78
Roland McGrath5dbccdb2009-06-28 14:48:02 -0700792009-06-28 Roland McGrath <roland@redhat.com>
80
81 * readelf.c (print_address_names): New static variable.
82 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
83 (format_dwarf_addr): Don't look up name if !print_address_names.
84
Ulrich Drepperf1894932009-06-13 15:55:42 -0700852009-06-13 Ulrich Drepper <drepper@redhat.com>
86
87 * ldgeneric.c: Don't use deprecated libelf functions.
88 * nm.c: Likewise.
89 * objdump.c: Likewise.
90 * readelf.c: Likewise.
91 * size.c: Likewise.
92 * strip.c: Likewise.
93 * unstrip.c: Likewise.
94 * ld.h: Fix up comment.
95
Ulrich Drepperb47d2902009-06-01 07:38:32 -0700962009-06-01 Ulrich Drepper <drepper@redhat.com>
97
98 * readelf.c (print_relocs): Expect ELF header argument and pass on
99 to handle_relocs_rel* functions. Adjust caller.
100 (handle_relocs_rel): Add ELF header argument. Add special case for
101 the IRELATIVE relocations in statically linked executables.
102 (handle_relocs_rela): Likewise.
103
Roland McGrathdb19f0b2009-05-07 18:44:27 -07001042009-04-29 Ulrich Drepper <drepper@redhat.com>
105
106 * elflint.c (check_symtab): Add tests of st_other field.
107
Ulrich Drepperaab90f92009-04-23 07:44:36 -07001082009-04-23 Ulrich Drepper <drepper@redhat.com>
109
110 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
111
Roland McGrathd86e1832009-04-20 00:49:33 -07001122009-04-20 Roland McGrath <roland@redhat.com>
113
Roland McGrath8a592412009-04-20 01:20:44 -0700114 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
115 of inline call sites.
116
Roland McGrathd86e1832009-04-20 00:49:33 -0700117 * addr2line.c (just_section): New variable.
118 (adjust_to_section): New function, broken out of ...
119 (handle_address): ... here.
120 (options, parse_opt): Add -j/--section=NAME to set it.
121
Roland McGrath2fb90512009-04-15 14:47:13 -07001222009-04-15 Roland McGrath <roland@redhat.com>
123
124 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
125 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
126
Roland McGrath04a14162009-04-14 01:02:17 -07001272009-04-14 Roland McGrath <roland@redhat.com>
128
Roland McGratheb9ba472009-04-14 18:44:45 -0700129 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
130 like SHT_GNU_ATTRIBUTES.
131
Roland McGrath94f43832009-04-14 04:39:32 -0700132 * readelf.c (handle_core_registers): Fix error message.
133
Roland McGrath04a14162009-04-14 01:02:17 -0700134 * strip.c (handle_elf: check_preserved): Don't note any change when
135 .debug_data is already filled from a previous pass.
136
Ulrich Drepper411cdb22009-02-05 22:04:26 -08001372009-02-05 Ulrich Drepper <drepper@redhat.com>
138
Ulrich Drepper51b3f472009-02-05 22:10:39 -0800139 * objdump.c (show_relocs_x): Minor cleanups.
140
Ulrich Drepper411cdb22009-02-05 22:04:26 -0800141 * readelf.c (print_cfa_program): Correct a few labels.
Ulrich Drepper973a9c72009-02-05 22:56:39 -0800142 Print first DW_CFA_expression and DW_CFA_val_expression parameter
143 as register.
Ulrich Drepper411cdb22009-02-05 22:04:26 -0800144
Ulrich Drepper5ee720c2009-02-01 16:18:18 -08001452009-02-01 Ulrich Drepper <drepper@redhat.com>
146
Ulrich Drepper95fa15e2009-02-01 19:06:10 -0800147 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
148 into ...
149 (show_relocs_x): ...here. New function.
Ulrich Drepperf44f0ce2009-02-01 21:31:26 -0800150 (show_relocs): Better spacing in output.
Ulrich Drepper95fa15e2009-02-01 19:06:10 -0800151
Ulrich Dreppercbb422e2009-02-01 18:18:55 -0800152 * objdump.c (show_relocs_rela): Show offsets as signed values.
153
Ulrich Drepper5ee720c2009-02-01 16:18:18 -0800154 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
155 Improve some error messages.
156 Use program_invocation_short_name instead of AR macro.
157 * Makefile.am (CFLAGS_ar): Remove.
158 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
159 * objdump.c (parse_opt): Likewise.
160 * readelf.c (parse_opt): Likewise.
161
Roland McGrath51f01282009-01-27 17:08:03 -08001622009-01-27 Roland McGrath <roland@redhat.com>
163
164 * readelf.c (print_ops): Notice short length, don't overrun buffer
165 (still need to fix LEB128).
166
167 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
168
169 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
170
Ulrich Drepper62c46532009-01-24 17:01:08 -08001712009-01-24 Ulrich Drepper <drepper@redhat.com>
172
173 * readelf.c (print_debug_frame_section): Fix computation of vma_base
174 for PC-relative mode.
175
Ulrich Drepperd7285e12009-01-23 16:10:44 -08001762009-01-23 Ulrich Drepper <drepper@redhat.com>
177
Ulrich Drepperccccab02009-01-23 16:32:21 -0800178 * size.c (process_file): When handling archive, close file descriptor
179 here. For unknown file format also close file descriptor.
180 (handle_ar): Don't close file descriptor here.
181
Ulrich Drepperd7285e12009-01-23 16:10:44 -0800182 * readelf.c (parse_opt): Move code to add to dump_data_sections and
183 string_sections list in local function add_dump_section. Adjust 'x'
184 key handling. For 'a' key add .strtab, .dynstr, and .comment section
185 to string_sections list.
186
Roland McGrathe9de9b42009-01-22 13:05:40 -08001872009-01-22 Roland McGrath <roland@redhat.com>
188
Roland McGrath9a847e12009-01-22 19:55:00 -0800189 * readelf.c (print_phdr): Don't print section mapping when no sections.
190
Roland McGrathd759aa62009-01-22 19:17:07 -0800191 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
192
Roland McGrathcabeeee2009-01-22 13:17:45 -0800193 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
194 and reset it only for the 'true' cases.
195
196 * Makefile.am (addr2line_no_Wformat): New variable.
197
Roland McGrathe9de9b42009-01-22 13:05:40 -0800198 * readelf.c (print_debug_frame_section): Use t instead of j formats
199 for ptrdiff_t OFFSET.
200
Ulrich Drepperdaf0fda2009-01-21 13:05:36 -08002012009-01-21 Ulrich Drepper <drepper@redhat.com>
202
203 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
Ulrich Drepperf93ee8d2009-01-21 15:02:03 -0800204 test. Handle debuginfo files.
Ulrich Drepperdaf0fda2009-01-21 13:05:36 -0800205 (check_exception_data): First sanity test.
206
Ulrich Drepperfdc93e12009-01-17 11:47:10 -08002072009-01-17 Ulrich Drepper <drepper@redhat.com>
208
Ulrich Drepper935edde2009-01-17 16:06:42 -0800209 * readelf.c (print_debug_exception_table): Show target of ar_disp
210 field.
211
212 * elflint.c (check_program_header): Add most consistency checks for
213 PT_GNU_EH_FRAME entry.
214
Ulrich Drepperfdc93e12009-01-17 11:47:10 -0800215 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
216 ARGP_PROGRAM_BUG_ADDRESS_DEF.
217 * ar.c: Likewise.
218 * elfcmp.c: Likewise.
219 * elflint.c: Likewise.
220 * findtextrel.c: Likewise.
221 * ld.c: Likewise.
222 * nm.c: Likewise.
223 * objdump.c: Likewise.
224 * ranlib.c: Likewise.
225 * readelf.c: Likewise.
Ulrich Drepper935edde2009-01-17 16:06:42 -0800226
Ulrich Drepperfdc93e12009-01-17 11:47:10 -0800227 * size.c: Likewise.
228 * strings.c: Likewise.
229 * strip.c: Likewise.
230 * unstrip.c: Likewise.
231
Ulrich Drepperb006fbf2009-01-16 03:08:25 -08002322009-01-16 Ulrich Drepper <drepper@redhat.com>
233
Ulrich Drepper3a52c7a2009-01-16 21:11:49 -0800234 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
235 matches .eh_frame_hdr section, if it is available. Also check that
236 the segment is allocated, not writable, not executable.
237
Ulrich Drepperb006fbf2009-01-16 03:08:25 -0800238 * readelf.c: Add -e option. Dump exception and unwind related
239 sections. Add -e to -a.
Ulrich Drepper05d2b202009-01-16 17:58:54 -0800240 (print_encoding_base): Handle DW_EH_PE_omit.
Ulrich Drepperb006fbf2009-01-16 03:08:25 -0800241 (print_debug_exception_table): Beginning of support.
242 (print_debug): Hook up print_debug_exception_table for
243 .gcc_except_table sections.
244
245 * readelf.c (print_debug_frame_section): Some fixes for last change.
246
Ulrich Drepper351bf202009-01-15 20:18:40 -08002472009-01-15 Ulrich Drepper <drepper@redhat.com>
248
249 * readelf.c (print_encoding): Now a toplevel function.
250 (print_relinfo): Likewise.
251 (print_encoding_base): Broken out of print_debug_frame_section.
252 (print_debug_frame_section): Print different header for .eh_frame
253 sections. Fix recognition of matching CIEs in .debug_frame sections.
254 Print absolute offset for PC-relative FDE locations. Don't print
255 table header for FDEs if the table is empty.
256 (read_encoded): New function.
257 (print_debug_frame_hdr_section): New function.
258 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
259 sections.
260
261 * readelf.c (handle_relocs_rel): Print section number.
262 (print_debug_abbrev_section): Likewise.
263 (print_debug_aranges_section): Likewise.
264 (print_debug_ranges_section): Likewise.
265 (print_debug_info_section): Likewise.
266 (print_debug_line_section): Likewise.
267 (print_debug_loc_section): Likewise.
268 (print_debug_macinfo_section): Likewise.
269 (print_debug_pubnames_section): Likewise.
270 (print_debug_str_section): Likewise.
271
Ulrich Drepper8b394632009-01-10 18:29:56 -08002722009-01-10 Ulrich Drepper <drepper@redhat.com>
273
274 * strings.c (read_block): Fix typo in error message string.
275
Ulrich Drepper87cf5832009-01-07 20:39:21 -08002762009-01-07 Ulrich Drepper <drepper@redhat.com>
277
278 * ld.c (ld_new_searchdir): Fix adding to search path list.
279
Ulrich Drepperac194d02009-01-06 00:30:01 -08002802009-01-06 Ulrich Drepper <drepper@redhat.com>
281
282 * readelf.c: Implement call frame debug section dumping.
Roland McGrathe9243e62009-01-21 18:54:20 -0800283
Roland McGrath3614d992009-01-05 18:05:32 -08002842009-01-05 Roland McGrath <roland@redhat.com>
285
286 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
287 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
Ulrich Drepperac194d02009-01-06 00:30:01 -0800288
Ulrich Drepper44173ed2009-01-01 19:00:41 -08002892009-01-01 Ulrich Drepper <drepper@redhat.com>
290
291 * addr2line.c: Update copyright year.
292 * ar.c: Likewise.
293 * elfcmp.c: Likewise.
294 * elflint.c: Likewise.
295 * findtextrel.c: Likewise.
296 * ld.c: Likewise.
297 * nm.c: Likewise.
298 * objdump.c: Likewise.
299 * ranlib.c: Likewise.
300 * readelf.c: Likewise.
301 * size.c: Likewise.
302 * strings.c: Likewise.
303 * strip.c: Likewise.
304 * unstrip.c: Likewise.
305
Roland McGrath468fe4d2008-12-11 21:00:12 -08003062008-12-11 Roland McGrath <roland@redhat.com>
307
308 * nm.c (sym_name): New function.
309 (show_symbols_sysv): Use it in place of elf_strptr.
310 (show_symbols_bsd, show_symbols_posix): Likewise.
311 Fixes RHBZ#476136.
312
313 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
314 elf_strptr fails.
315
Roland McGratha845f682008-12-03 03:41:58 +00003162008-12-02 Roland McGrath <roland@redhat.com>
317
318 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
319 nonzero OFFSET argument to dwfl_getmodules.
320
Roland McGrath1d8bb252008-08-07 08:39:41 +00003212008-08-07 Roland McGrath <roland@redhat.com>
322
323 * addr2line.c (main): Pass string to handle_address.
324 (see_one_module): New function, subroutine of handle_address.
325 (find_symbol): Likewise.
326 (handle_address): Take string argument rather than address.
327 Convert plain number, or handle strings like "(section)+offset"
328 or "symbol+offset".
329
3302008-08-01 Roland McGrath <roland@redhat.com>
331
332 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
333 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
334
335 * readelf.c (convert): Take new argument SIZE.
336 (handle_core_register, handle_core_item): Update callers.
337 (handle_core_item): Take new arg REPEATED_SIZE.
338 (handle_core_items): Special case for a singleton item,
339 let handle_core_item handle repeats if it wants to.
340
341 * readelf.c (handle_core_items): Give abridged output
342 for identical groups repeated more than twice.
343
3442008-07-04 Roland McGrath <roland@redhat.com>
345
346 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
347
Roland McGrath521c47d2008-04-11 07:01:58 +00003482008-04-10 Roland McGrath <roland@redhat.com>
349
350 * strip.c (handle_elf): Don't keep sections that kept symbol tables
351 refer to. Instead, just be sure to preserve the original symbol
352 table in the debug file so those symbols go with their sections and
353 can be elided from the stripped version of the symbol table.
354
355 * strip.c (handle_elf): When a discarded section kept in the debug
356 file refers to a nondiscard section via sh_link/sh_info, preserve
357 that nondiscarded section unmodified in the debug file as well.
358 Skip adjustment of discarded sections symbol table references when
359 that symbol table is copied in this way.
360
361 * elflint.c (check_symtab): Don't crash from missing symbol names
362 after diagnosing bogus strtab.
363
364 * strip.c (handle_elf): Cosmetic cleanup in special section contents
365 adjustment for symtab changes.
366
Roland McGrath13b69602008-04-01 02:30:05 +00003672008-03-31 Roland McGrath <roland@redhat.com>
368
369 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
370 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
371 excuse a special section.
372
3732008-03-27 Roland McGrath <roland@redhat.com>
374
375 * elflint.c (check_sections): Check that executability and writability
376 of sections is reflected in segment p_flags.
377
Roland McGrathd11f9cb2008-03-26 20:51:59 +00003782008-03-26 Roland McGrath <roland@redhat.com>
379
380 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
381 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
382 is valid in RELRO.
383
Roland McGrath47c5c352008-02-29 10:17:16 +00003842008-02-29 Roland McGrath <roland@redhat.com>
385
386 * readelf.c (print_attributes): Add a cast.
387 * elflint.c (check_attributes): Likewise.
388
389 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
390 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
391 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
392
Ulrich Drepper834de6f2008-02-23 06:50:01 +00003932008-02-03 Ulrich Drepper <drepper@redhat.com>
394
395 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
396 when linked into executable.
397 (elf_i386_create_relocations): Likewise.
398
Roland McGrath059c83e2008-02-21 06:19:39 +00003992008-02-20 Roland McGrath <roland@redhat.com>
400
401 * readelf.c (print_attributes): New function.
402 (process_elf_file): Call it under -A.
403
404 * elflint.c (check_attributes): Implement it for real.
405
4062008-02-19 Roland McGrath <roland@redhat.com>
407
408 * elflint.c (special_sections): Handle .gnu.attributes section.
409 (check_sections): Likewise.
410 (check_attributes): New function.
411
4122008-02-10 Roland McGrath <roland@redhat.com>
413
414 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
415 sections and ET_REL files.
416
Ulrich Drepper712d78e2008-02-02 10:01:53 +00004172008-02-02 Ulrich Drepper <drepper@redhat.com>
418
419 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
420 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
421 and R_386_TLS_LE.
422 (elf_i386_create_relocations): Likewise.
423 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
424 elements.
425 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
426 (ld_generic_create_outfile): Add PT_TLS entry to program header.
427 Fix generation of PT_GNU_STACK entry.
428
Ulrich Drepperc54785a2008-02-01 18:05:21 +00004292008-02-01 Ulrich Drepper <drepper@redhat.com>
430
Ulrich Drepper7cd1bf72008-02-01 23:52:59 +0000431 * ld.c (replace_args): Prevent loop over replacements if the parameter
432 is only two characters long.
433
Ulrich Drepperc54785a2008-02-01 18:05:21 +0000434 * ld.c: Recognize sha1 argument for --build-id parameter.
435 * ldgeneric.c (create_build_id_section): Handle sha1.
436 (compute_hash_sum): New function. Broken out of compute_build_id.
437 Take hash function and context as parameters.
438 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
439 implementation.
440
Ulrich Drepper89759c72008-01-31 19:44:12 +00004412008-01-31 Ulrich Drepper <drepper@redhat.com>
442
443 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
444 * ld.c: Recognize --build-id command line parameter.
445 * ld.h: Define scn_dot_note_gnu_build_id.
446 (struct ld_state): Add build_id and buildidscnidx elements.
447 * ldgeneric.c: Implement --build-id command line parameter.
448 * ldlex.l (ID): Recognize - as valid character after the first one.
449
Ulrich Drepper5530ec52008-01-29 10:42:07 +00004502008-01-29 Ulrich Drepper <drepper@redhat.com>
451
Ulrich Drepperb61c4cc2008-01-30 07:16:28 +0000452 * ld.c (replace_args): New function.
453 (main): Use it to rewrite old-style parameters.
454
Ulrich Dreppered9b6cb2008-01-30 06:33:33 +0000455 * elf32-i386.script: Add .gnu.hash section.
456 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
457 (fillin_special_symbol): Initialize st_size.
458 (sortfct_hashval): New function.
459 (create_gnu_hash): New function.
460 (create_hash): New function.
461 (ld_generic_create_outfile): Use the new functions to create the
462 hash tables.
463
Ulrich Drepper5530ec52008-01-29 10:42:07 +0000464 * elflint.c (check_gnu_hash): Fix index value printed in error message.
465
Ulrich Drepper0e864dd2008-01-25 00:18:42 +00004662008-01-24 Ulrich Drepper <drepper@redhat.com>
467
468 * elflint.c (check_group): Check that signature symbol for section
469 group is not an empty string.
470 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
471 section. Start implementation of --hash-style.
472 * i386_ld.c: Likewise.
473 * ld.c: Recognize --hash-style.
474 * ld.h (struct scninfo): Add comdat_group.
475 Add additional parameter to finalize_plt callback.
476
Ulrich Drepper5449a6b2008-01-22 15:49:39 +00004772008-01-22 Ulrich Drepper <drepper@redhat.com>
478
479 * ld.h (struct callbacks): Add initialize_gotplt.
480 (struct scnhead): Add scn_dot_gotplt.
481 (struct ld_state): Add gotpltscnidx.
482 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
483 (elf_i386_initialize_pltrel): Likewise.
484 (elf_i386_initialize_got): There is now a separate .got.plt, so
485 don't do the PLT-related work here. Initialize d_type.
486 (elf_i386_initialize_gotplt): New function.
487 (elf_i386_plt0): Use ud2a after indirect jump.
488 (elf_i386_pic_plt0_entry): Likewise.
489 (elf_i386_finalize_plt): Reference now .got.plt.
490 (elf_i386_count_relocations): For GOT entries which need no relocation
491 don't bump nrel_got.
492 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
493 handling for split .got/.got.plt.
494 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
495 * elf32-i386.script: Sort sections for security. There are no .got
496 input sections. Add .got.plt.
497 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
498 (ld_generic_create_outfile): Initialize .got.plt section.
499 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
500
Ulrich Drepperd9488292008-01-20 16:43:15 +00005012008-01-19 Ulrich Drepper <drepper@redhat.com>
502
503 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
504 symbols are not carried over into statically linked output files.
505 Add dummy entries for more TLS relocations.
506
507 * ld.c (options): Add long names for -( and -).
508
509 * ldgeneric.c (check_definition): For newly found definitions don't
510 mark section as used if symbol is absolute.
511 (extract_from_archive): Only assign archive sequence number the first
512 time the archive is handled. Update ld_state.last_archive_used
513 if any symbol was used. Remove nround variable.
514 (file_process2): When using symbol from an archive, update
515 ld_state.group_start_archive, ld_state.archives, and
516 ld_state.tailarchives.
517 (ld_generic_file_process): If group is not handled anymore, after
518 freeing ELF handles for the archives, clear ld_state.archives and
519 *nextp. Fix wrong logic in recognizing first iteration of group
520 loop. When clearing flags, also clear ld_state.group_start_archive.
521
Ulrich Drepper5eee1222008-01-11 10:12:18 +00005222008-01-11 Ulrich Drepper <drepper@redhat.com>
523
524 * objdump.c (show_disasm): Adjust disassembler format string for
525 removal of %e.
526
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00005272008-01-04 Roland McGrath <roland@redhat.com>
528
Roland McGrath059c83e2008-02-21 06:19:39 +0000529 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
530 a size greater than the items cover means multiple sets of items.
531 (handle_core_note): Update caller.
532
5332008-01-04 Roland McGrath <roland@redhat.com>
534
Ulrich Dreppere219f1c2008-01-09 05:49:49 +0000535 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
536
5372008-01-03 Roland McGrath <roland@redhat.com>
538
539 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
540
541 * elflint.c (check_dynamic): Remove duplicate initializer.
542
Ulrich Drepperad024af2008-01-02 17:42:52 +00005432008-01-02 Ulrich Drepper <drepper@redhat.com>
544
545 * addr2line.c: Update copyright year.
546 * ar.c: Likewise.
547 * elfcmp.c: Likewise.
548 * elflint.c: Likewise.
549 * findtextrel.c: Likewise.
550 * ld.c: Likewise.
551 * nm.c: Likewise.
552 * objdump.c: Likewise.
553 * ranlib.c: Likewise.
554 * readelf.c: Likewise.
555 * size.c: Likewise.
556 * strings.c: Likewise.
557 * strip.c: Likewise.
558 * unstrip.c: Likewise.
559
Ulrich Drepper3cbdd382008-01-02 17:44:39 +00005602007-12-30 Ulrich Drepper <drepper@redhat.com>
561
562 * objdump (show_disasm): Use %e after third parameter.
563
5642007-12-21 Ulrich Drepper <drepper@redhat.com>
565
566 * strip.c: Fix wrong parenthesis in a few branch predictions.
567 * strings.c: Likewise.
568
5692007-12-20 Ulrich Drepper <drepper@redhat.com>
570
571 * Makefile.am (DEFS): Add DEBUGPRED.
572 * addr2line.c: Include debugpred.h.
573 * ar.c: Likewise.
574 * elfcmp.c: Likewise.
575 * elflint.c: Likewise.
576 * findtextrel.c: Likewise.
577 * nm.c: Likewise.
578 * objdump.c: Likewise.
579 * ranlib.c: Likewise.
580 * readelf.c: Likewise.
581 * size.c: Likewise.
582 * strings.c: Likewise.
583 * strip.c: Likewise.
584 * unstrip.c: Likewise.
585 * debugpred.h: New file.
586
587 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
588 (handle_relocs_rela): Likewise.
589
590 * readelf.c: Add lots of likely/unlikely.
591
592 * elflint.c: Minor cleanups.
593
Roland McGrath1a2e8f42007-12-15 23:39:34 +00005942007-11-19 Roland McGrath <roland@redhat.com>
595
596 * readelf.c (print_ops): Handle all bad op codes gracefully.
597 Print their numbers instead of just ???.
598
Roland McGrath07a696e2007-11-09 22:44:26 +00005992007-11-09 Roland McGrath <roland@redhat.com>
600
601 * readelf.c (attr_callback): Handle DW_AT_data_location.
Roland McGrath1a2e8f42007-12-15 23:39:34 +0000602 Handle block forms to mean a DWARF expression for DW_AT_allocated,
603 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
604 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
605 DW_AT_upper_bound.
Roland McGrath07a696e2007-11-09 22:44:26 +0000606
Roland McGrathe4c22ea2007-10-23 13:07:39 +00006072007-10-20 Roland McGrath <roland@redhat.com>
608
609 * unstrip.c (options): Update -R description.
610 (struct symbol): Put symbol details a union with a size_t pointer
611 `duplicate'.
612 (compare_symbols_output): Use null ->name as marker for discard
613 symbols, not zero *->map.
614 (copy_elided_sections): Record forwarding pointers for discarded
615 duplicates and fill SYMNDX_MAP elements through them.
616
617 * readelf.c (process_file): Set offline_next_address to 0 at start.
618 (struct process_dwflmod_args): New type.
619 (process_dwflmod): Take args in it, pass fd to process_elf_file.
620 (process_file): Update caller; dup FD for passing to libdwfl.
621 (process_elf_file): Take new arg FD. For ET_REL file when
622 displaying data affected by libdwfl relocation, open a new Elf handle.
623
6242007-10-17 Roland McGrath <roland@redhat.com>
625
626 * readelf.c (print_debug_line_section): For invalid data inside a
627 unit with plausible length, keep printing at the next unit boundary.
628
629 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
630
6312007-10-16 Roland McGrath <roland@redhat.com>
632
633 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
634
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00006352007-10-15 Roland McGrath <roland@redhat.com>
636
637 * make-debug-archive.in: New file.
638 * Makefile.am (EXTRA_DIST): Add it.
639 (make-debug-archive): New target.
640 (bin_SCRIPTS, CLEANFILES): Add it.
641
6422007-10-10 Roland McGrath <roland@redhat.com>
643
644 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
645 Use it to check MERGE|STRINGS for .debug_str.
646 (check_sections): Handle exact_or_gnuld.
647
6482007-10-08 Roland McGrath <roland@redhat.com>
649
650 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
651 64-bit struct timeval with 32-bit tv_usec.
652
6532007-10-07 Roland McGrath <roland@redhat.com>
654
655 * readelf.c (check_archive_index): New function.
656 (process_file): Call it. Change signature to take only fd and name.
657 Use libdwfl to open the file, then iterate on its modules (multiple
658 for an archive) to print file name and call process_elf_file.
659 (main): Update caller. Let process_file do elf_begin.
660 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
661 (process_elf_file): Take only Dwfl_Module * argument.
662 Don't print the file name here.
663 (print_debug_*_section): Take Dwfl_Module * argument.
664 (print_debug): Likewise. Update caller.
665 (format_dwarf_addr): New function.
666 (print_debug_ranges_section): Use it.
667 (attr_callback): Likewise.
668 (print_debug_line_section, print_debug_loc_section): Likewise.
669
670 * readelf.c (print_debug_ranges_section): Translate all strings.
671 (print_debug_loc_section): Likewise.
672
673 * unstrip.c (copy_elided_sections): Initialize SEC.
674
675 * ar.c (do_oper_insert): Put trailing / on short names.
676
677 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
678
679 * arlib2.c (arlib_add_long_name): Adjust for header size.
680
681 * arlib.c (arlib_finalize): Pad long name table to keep size even.
682
683 * ar.c (do_oper_insert): Use write_retry for padding write.
684
685 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
686 Unconditionally set FOUND[CNT]->elf when setting ->mem.
687 (remember_long_name): New function.
688 (do_oper_insert): Call it. Correctly use length of basename,
689 not original name. Don't store long name twice for new member.
690
6912007-10-06 Roland McGrath <roland@redhat.com>
692
693 * elflint.c (check_note): Skip empty segment.
694 (check_note_section): Skip empty section.
695
696 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
697 (handle_output_dir_module, handle_implicit_modules): Pass it down.
698 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
699 (compare_alloc_sections): Take new arg REL, ignore address if true.
700 (compare_sections): Likewise, pass it down.
701 (compare_sections_rel, compare_sections_nonrel): New functions.
702 (find_alloc_sections_prelink, copy_elided_sections): Use them
703 instead of compare_sections.
704 (sections_match): New function, broken out of ...
705 (find_alloc_section): ... here.
706 (copy_elided_sections): Reorganize section match-up logic.
707 Use sections_match for SHF_ALLOC in ET_REL.
708 For ET_REL, let the nonzero sh_addr from the debug file dominate.
709
710 * unstrip.c (add_new_section_symbols): Take new arg REL.
711 When true, do not update section symbol values.
712 (collect_symbols): Likewise. Update section symbols with address
713 of chosen output section, not original section.
714 (check_symtab_section_symbols, copy_elided_sections): Update callers.
715
716 * unstrip.c (compare_alloc_sections): At the same address, preserve
717 original section order.
718
719 * elflint.c (special_sections): Don't require MERGE|STRINGS for
720 .debug_str, it didn't always have them with older tools.
721
722 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
723
7242007-10-05 Roland McGrath <roland@redhat.com>
725
726 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
727 ET_REL file.
728
729 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
730 SHN_UNDEF as "bad section". Use shndx value in messages.
731
732 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
733 for ".debug" so it matches as a prefix.
734 (IS_KNOWN_SPECIAL): New macro.
735 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
736 type even under -d, for a .debug* or .shstrtab section.
737
738 * readelf.c (print_ops): Use hex for address operand.
739
7402007-10-04 Roland McGrath <roland@redhat.com>
741
742 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
743 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
744 sections mapped to SHN_UNDEF.
745
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00007462007-10-04 Ulrich Drepper <drepper@redhat.com>
747
748 * readelf.c (dump_archive_index): Avoid warning about uninitialized
749 variable with older glibc versions.
750 Add some branch prediction.
751
Roland McGrath59ea7f32007-10-04 08:50:09 +00007522007-10-04 Roland McGrath <roland@redhat.com>
753
754 * readelf.c (print_archive_index): New variable.
755 (options, parse_opt): Accept -c/--archive-index to set it.
756 (dump_archive_index): New function.
757 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
758 Call dump_archive_index on archives if set.
759 (main): Update caller.
760 (any_control_option): Give it file scope, moved out of ...
761 (parse_opt): ... here.
762
7632007-10-03 Roland McGrath <roland@redhat.com>
764
765 * unstrip.c (struct arg_info): Add `list' flag.
766 (options, parse_opt): Grok -n/--list to set it.
767 (list_module): New function.
768 (handle_implicit_modules): Call it under -n.
769
770 * elflint.c (check_note_section): New function.
771 (check_sections): Call it for SHT_NOTE.
772
773 * readelf.c (handle_notes): Use sections when available.
774
775 * elflint.c (check_note_data): New function, broken out of ...
776 (check_note): ... here. Call it and elf_getdata_rawchunk.
777
778 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
779 Use elf_getdata_rawchunk and gelf_getauxv.
780 (handle_notes_data): New function, broken out of ...
781 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
782
Roland McGrath241ac022007-10-01 18:21:46 +00007832007-10-01 Roland McGrath <roland@redhat.com>
784
Roland McGrathac0a16c2007-10-01 18:50:35 +0000785 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
786
Roland McGrath241ac022007-10-01 18:21:46 +0000787 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
788
Roland McGrathc76f0b02007-09-27 07:31:33 +00007892007-09-10 Roland McGrath <roland@redhat.com>
790
791 * readelf.c (options): Give -p optional argument, alias --string-dump.
792 (string_sections, string_sections_tail): New static variables.
793 (parse_opt): Set them when -p has an argument.
794 (print_string_section): New function, broken out of ...
795 (print_strings): ... here. Call it.
796 (dump_data_section): New function, broken out of ...
797 (dump_data): ... here. Call it.
798 (for_each_section_argument): New function, broken out of ...
799 (dump_data): ... here. Call it.
800 (dump_strings): New function.
801
8022007-08-31 Roland McGrath <roland@redhat.com>
803
804 * readelf.c (print_strings): Typo fix.
805
Roland McGrathcb6d8652007-08-23 08:10:54 +00008062007-08-23 Roland McGrath <roland@redhat.com>
807
808 * readelf.c (printf_with_wrap): Function removed.
809 (REGISTER_WRAP_COLUMN): New macro.
810 (handle_core_register): Use print_core_item instead.
811 (struct register_info): New type.
812 (compare_registers, compare_register_sets): New functions.
813 (register_bitpos, compare_sets_by_info): New functions.
814 (handle_core_registers): Use those to segregate and sort registers
815 for display.
816
817 * readelf.c (ITEM_WRAP_COLUMN): New macro.
818 (print_core_item): New function.
819 (handle_core_item): Use it instead of printf_with_wrap.
820 (compare_core_items, compare_core_item_groups): New functions.
821 (handle_core_items): Use them. Sort by group and force line breaks
822 between groups.
823
824 * readelf.c (handle_core_registers, handle_core_items): New functions,
825 broken out of ...
826 (handle_core_note): ... here. Call them.
827
8282007-08-22 Roland McGrath <roland@redhat.com>
829
830 * unstrip.c (new_shstrtab): New function, broken out of ...
831 (copy_elided_sections): ... here.
832
8332007-08-20 Roland McGrath <roland@redhat.com>
834
835 Avoid local function trampolines in nm binary.
836 * nm.c (sort_by_address): Move to a static function instead of local
837 inside show_symbols.
838 (sort_by_name_strtab): New static variable.
839 (sort_by_name): Use it. Move to a static function instead of local
840 inside show_symbols.
841 (show_symbols): Set sort_by_name_strtab.
842
8432007-08-19 Roland McGrath <roland@redhat.com>
844
845 * readelf.c (handle_auxv_note): New function.
846 (handle_notes): Call it.
847
848 * readelf.c (printf_with_wrap, convert): New functions.
849 (handle_core_item, (handle_core_register): New functions.
850 (handle_notes): Call those with details from ebl_core_note.
851
Roland McGrath099dd522007-08-13 22:58:36 +00008522007-08-12 Roland McGrath <roland@redhat.com>
853
854 * elflint.c (check_note): Accept type 0 with name "Linux".
855
856 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
857
858 * elflint.c (section_flags_string): Return "none" for 0, not "".
859
Roland McGrathd8221722007-08-11 21:18:09 +00008602007-08-11 Roland McGrath <roland@redhat.com>
861
862 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
863
Ulrich Drepperc98bcc72007-08-04 17:06:14 +00008642007-08-04 Ulrich Drepper <drepper@redhat.com>
865
866 * readelf.c (hex_dump): Use isprint to determine whether to print
867 character itself or full stop character.
868 (dump_data): No need to check endp for NULL after strtol call.
869
Roland McGrath60fc84c2007-08-03 21:59:15 +00008702007-08-03 Roland McGrath <roland@redhat.com>
871
872 * readelf.c (print_string_sections): New variable.
873 (options, parse_opt): Handle --strings/-p to set it.
874 (print_strings): New function.
875 (process_elf_file): Call it under -p.
876
877 * readelf.c (options): Add hidden aliases --segments, --sections,
878 as taken by binutils readelf.
879
8802007-08-01 Roland McGrath <roland@redhat.com>
881
882 * readelf.c (dump_data_sections, dump_data_sections_tail):
883 New variables.
884 (options, parse_opt): Handle --hex-dump/-x, set them.
885 (hex_dump): New function.
886 (dump_data): New function, call it.
887 (process_elf_file): Call it.
888
8892007-07-25 Roland McGrath <roland@redhat.com>
890
891 * addr2line.c (show_symbols): New variable.
892 (print_addrsym): New function.
893 (handle_address): Call it.
894 (options, parse_opt): Handle -S/--symbols.
895
Ulrich Drepperb0243862007-06-06 00:09:36 +00008962007-06-05 Ulrich Drepper <drepper@redhat.com>
897
898 * addr2line.c: Update for latest autoconf header.
899 * ar.c: Likewise.
900 * elfcmp.c: Likewise.
901 * elflint.c: Likewise.
902 * findtextrel.c: Likewise.
903 * ld.c: Likewise.
904 * ldgeneric.c: Likewise.
905 * nm.c: Likewise.
906 * objdump.c: Likewise.
907 * ranlib.c: Likewise.
908 * readelf.c: Likewise.
909 * size.c: Likewise.
910 * strings.c: Likewise.
911 * strip.c: Likewise.
912 * unstrip.c: Likewise.
913
Roland McGrath9aa8ef72007-05-18 08:59:43 +00009142007-05-18 Roland McGrath <roland@redhat.com>
915
916 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
917 stripped file, so as not to duplicate a section copied in both.
918
919 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
920
9212007-05-17 Roland McGrath <roland@redhat.com>
922
923 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
924
925 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
926
927 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
928 call make_directories here.
929 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
930 (handle_dwfl_module): Likewise.
931 (handle_implicit_modules): Update callers.
932 (handle_output_dir_module): Likewise. Don't do make_directories here.
933
934 * unstrip.c (get_section_name): New function, broken out of ...
935 (copy_elided_sections): here. Update callers.
936 (find_alloc_section): Broken out of ...
937 (copy_elided_sections): ... here. Update caller.
938 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
939 update STT_SECTION symbols' st_value fields as a side effect.
940 (check_symtab_section_symbols): Update caller.
941 (add_new_section_symbols): Set st_value in symbols added.
942 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
943 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
944 from .bss to .dynbss.
945 (find_alloc_sections_prelink): New function. Associate debug file
946 allocated SHT_NOBITS shdrs with stripped moved by prelink via
947 .gnu.prelink_undo information.
948 (copy_elided_sections): Call it when we couldn't find every allocated
949 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
950 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
951 (handle_file): Update callers.
952
953 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
954 named ".comment".
955
956 * elflint.c (check_sections): Fix association of segments with
957 sections when p_memsz > p_filesz.
958
9592007-04-29 Roland McGrath <roland@redhat.com>
960
961 * addr2line.c (options, main): Tweak argp group settings to fix
962 usage output.
963
9642007-04-28 Roland McGrath <roland@redhat.com>
965
966 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
967 sizes to match sections adjusted in the stripped file.
968
Roland McGrath4be15242007-04-25 03:09:33 +00009692007-04-24 Roland McGrath <roland@redhat.com>
970
971 * elfcmp.c (OPT_HASH_INEXACT): New macro.
972 (hash_inexact): New variable.
973 (options, parse_opt): Add --hash-inexact option to set it.
974 (hash_content_equivalent): New function.
975 (main): Call it for differing SHT_HASH sections under --hash-inexact.
976
9772007-04-23 Roland McGrath <roland@redhat.com>
978
979 * unstrip.c: New file.
980 * Makefile.am (bin_PROGRAMS): Add it.
981 (unstrip_LDADD): New variable.
982
983 * strip.c (options): Allow --output for -o.
984
Ulrich Drepper8b383102007-02-16 00:31:57 +00009852007-02-15 Ulrich Drepper <drepper@redhat.com>
986
987 * readelf.c: Remove unused code. Add a few consts.
988
Ulrich Drepper903c1162007-02-15 19:40:37 +00009892007-02-15 Roland McGrath <roland@redhat.com>
990
991 * readelf.c (print_debug): Fix brainos in SHDR test.
992
Roland McGrathf82a1ec2007-02-06 04:47:44 +00009932007-02-05 Roland McGrath <roland@redhat.com>
994
995 * ar.c: Include <limits.h>, since we use LONG_MAX.
996
Ulrich Drepper0fe63532007-02-05 21:05:51 +00009972007-02-05 Ulrich Drepper <drepper@redhat.com>
998
Ulrich Drepper8b383102007-02-16 00:31:57 +0000999 * ar.c: Add ugly hack to work around gcc complaining that we
Ulrich Drepper93ab56f2007-02-05 22:12:41 +00001000 ignore fchown's return value.
1001 (do_oper_insert): Handle error when writing padding.
1002 * ranlib.c: Add fchown complain work around.
1003
Ulrich Drepper0fe63532007-02-05 21:05:51 +00001004 * arlib.c: Make symtab a global variable. Change all users.
1005 * arlib2.c: Likewise.
1006 * ranlib.c: Likewise.
1007 * ar.c: Likewise.
1008 * arlib.h: Declare it.
1009
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000010102007-01-11 Roland McGrath <roland@redhat.com>
1011
1012 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
1013 SHF_MASKPROC bits separately from generic sh_flags validation.
1014
Ulrich Drepperce0bdb62007-02-05 07:13:52 +000010152007-02-04 Ulrich Drepper <drepper@redhat.com>
1016
1017 * ar.c: New file.
1018 * arlib.c: New file.
1019 * arlib2.c: New file.
1020 * arlib.h: New file.
1021 * Makefile (noinst_LIBRARIES): Add libar.
1022 (libar_a_SOURCES): Define.
1023 (ar_LDADD): Define.
1024 (CFLAGS_ar): Define.
1025 * ranlib.c: Change to use arlib.
1026
1027 * elflint.c (check_symtab): Work around GNU ld bug which omits
1028 sections but not symbols in those sections.
1029
Ulrich Drepperb770cf92007-01-10 21:02:34 +000010302007-01-10 Ulrich Drepper <drepper@redhat.com>
1031
1032 * addr2line.c: Update copyright year.
1033 * elfcmp.c: Likewise.
1034 * elflint.c: Likewise.
1035 * findtextrel.c: Likewise.
1036 * ld.c: Likewise.
1037 * nm.c: Likewise.
1038 * objdump.c: Likewise.
1039 * ranlib.c: Likewise.
1040 * readelf.c: Likewise.
1041 * size.c: Likewise.
1042 * strings.c: Likewise.
1043 * strip.c: Likewise.
1044
Ulrich Drepper7c0e79f2006-12-09 21:10:19 +000010452006-12-09 Ulrich Drepper <drepper@redhat.com>
1046
1047 * elflint.c (compare_hash_gnu_hash): New function. Report if the
1048 two hash tables have different content (module expected omission
1049 of undefined symbols).
1050
Roland McGrath8190db62006-12-17 23:56:51 +000010512006-10-31 Roland McGrath <roland@redhat.com>
1052
1053 * elflint.c (check_program_header): Don't complain about
Ulrich Drepper56bc0b82006-12-18 22:38:08 +00001054 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
Roland McGrath8190db62006-12-17 23:56:51 +00001055
10562006-09-19 Jakub Jelinek <jakub@redhat.com>
1057
1058 * strip.c (process_file): Disallow -f on archives.
1059
10602006-10-09 Roland McGrath <roland@redhat.com>
1061
1062 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
1063
Roland McGrathc373d852006-10-10 00:25:21 +000010642006-08-29 Roland McGrath <roland@redhat.com>
1065
1066 * Makefile.am (MAINTAINERCLEANFILES): New variable.
1067
1068 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
1069 Reported by Christian Aichinger <Greek0@gmx.net>.
1070
1071 * elflint.c (valid_e_machine): Add EM_ALPHA.
1072 Reported by Christian Aichinger <Greek0@gmx.net>.
1073
Ulrich Drepper231c5902006-08-08 22:00:11 +000010742006-08-08 Ulrich Drepper <drepper@redhat.com>
1075
1076 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1077 Keep track of which "high DT" entries are present.
1078 Check that either old or GNU-style hash table is present.
1079 If GNU-style hash table is used a symbol table is mandatory.
1080 Check that if any prelink entry is present all of them are.
1081 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
1082 table if they don't refer to functions.
1083
Roland McGrath858b1892006-07-17 08:41:15 +000010842006-07-17 Roland McGrath <roland@redhat.com>
1085
1086 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
1087 (add_version): Likewise for argument.
1088 (check_versym): Cast constant to GElf_Versym for comparison.
1089
Roland McGrath4ec807e2006-07-13 03:59:46 +000010902006-07-12 Roland McGrath <roland@redhat.com>
1091
1092 * readelf.c (handle_gnu_hash): Add casts for machines where
1093 Elf32_Word != unsigned int.
1094
Ulrich Drepperdcf61602006-07-12 19:59:02 +000010952006-07-12 Ulrich Drepper <drepper@redhat.com>
1096
1097 * elflint.c (check_sysv_hash64): Fix printf format.
1098
Ulrich Dreppercc415622006-07-12 19:42:23 +000010992006-07-11 Roland McGrath <roland@redhat.com>
Ulrich Drepper8ae58142006-07-12 05:22:32 +00001100
Ulrich Dreppercc415622006-07-12 19:42:23 +00001101 * addr2line.c (options): English fix in -f doc string.
1102
1103 * addr2line.c (use_comp_dir): New variable.
1104 (options, parse_opt): Grok -A/--absolute to set it.
1105 (handle_address): If set, prepend dwfl_line_comp_dir results to
1106 relative file names.
Ulrich Drepper8ae58142006-07-12 05:22:32 +00001107
Ulrich Drepper28ed8952006-07-07 03:43:47 +000011082006-07-06 Ulrich Drepper <drepper@redhat.com>
1109
1110 * elflint.c: Adjust for latest new hash table format.
1111 * readelf.c: Likewise.
1112
1113 * elflint.c (check_versym): Ignore hidden bit when comparing version
1114 numbers.
1115
11162006-07-05 Ulrich Drepper <drepper@redhat.com>
1117
1118 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
1119 discarded COMDAT symbols.
1120
1121 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
1122 (elf_i386_create_relocations): Likewise.
1123 * ld.h (struct symbol): Add local and hidden bits.
1124 * ld.c (create_special_section_symbol): These synthsized symbols
1125 are local and hidden.
1126 * ldgeneric.c (file_process2): Check whether input file matches
1127 the emulation.
1128 (fillin_special_symbol): Create symbols as local and/or hidden
1129 if requested.
1130 (ld_generic_create_outfile): Make local copy of symbol.
1131 Don't hide global, defined symbols in dynamic symbol table unless
1132 requested. Synthetic symbols have no version information.
1133
1134 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
1135 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
1136
11372006-07-04 Ulrich Drepper <drepper@redhat.com>
1138
1139 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
1140 testing.
1141
11422006-07-03 Ulrich Drepper <drepper@redhat.com>
1143
1144 * elflint.c: Add testing of DT_GNU_HASH.
1145 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
1146
1147 * Makefile.am: Add hacks to create dependency files for non-generic
1148 linker.
1149
Ulrich Drepper6ca46002006-06-12 22:40:23 +000011502006-06-12 Ulrich Drepper <drepper@redhat.com>
1151
1152 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1153 section if creating a DSO and no interpreter is given.
1154 (ld_generic_create_outfile): Don't store reference to symbols in
1155 discarded COMDAT groups. Don't create PHDR and INTERP program header
1156 for DSO if no interpreter is specified.
Ulrich Drepper595d0e72006-06-12 23:25:17 +00001157 (create_verneed_data): Pretty printing.
1158
Ulrich Drepper6ca46002006-06-12 22:40:23 +00001159 * ldscript.y (content): If a DSO is created don't set default
1160 interpreter from linker script.
1161
1162 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
1163 for symbols in discarded COMDAT groups.
1164 (elf_i386_create_relocations): Likewise.
1165 * ld.h (struct scninfo): Add unused_comdat.
1166 * ldgeneric.c (add_section): Also check group signature when
1167 matching COMDAT sections.
1168 (add_relocatable_file): Ignore symbols in COMDAT group which are
1169 discarded.
1170
1171 * elflint.c (check_one_reloc): For *_NONE relocs only check type
1172 and symbol reference.
1173
Ulrich Drepper54f33a72006-06-11 09:07:37 +000011742006-06-11 Ulrich Drepper <drepper@redhat.com>
1175
Ulrich Dreppercbb51e52006-06-11 20:25:23 +00001176 * elflint.c (check_dynamic): Fix checking value of tags which are
1177 offsets in the string section. Make sure DT_STRTAB points to the
1178 section referenced in sh_link.
1179
1180 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
1181
Ulrich Drepper54f33a72006-06-11 09:07:37 +00001182 * ld.c: Recognize --eh-frame-hdr option.
1183 * ld.h (struct ld_state): Add eh_frame_hdr field.
1184 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
1185
1186 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
1187 SH_FLAGS_COMBINE.
1188 (add_relocatable_file): Minor optimization of last change.
1189 (match_section): Don't preserve SHF_GROUP flag any longer.
1190
Ulrich Drepper2d880282006-06-11 00:20:43 +000011912006-06-10 Ulrich Drepper <drepper@redhat.com>
1192
1193 * ld.c (parse_z_option): Recognize execstack and noexecstack.
Ulrich Drepper4f0a7a82006-06-11 00:53:45 +00001194 Handle record and ignore as position dependent options.
1195 (parse_z_option_2): Handle ignore and record here.
Ulrich Drepper2d880282006-06-11 00:20:43 +00001196 * ld.h (struct ld_state): Add execstack field.
1197 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
1198 sections.
1199 (ld_generic_create_outfile): Fix program header creation in native
1200 linker. Add PT_GNU_STACK program header.
1201
Ulrich Dreppera688a732006-06-10 06:33:00 +000012022006-06-09 Ulrich Drepper <drepper@redhat.com>
1203
1204 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
1205 for PLT entries if there is no local definition.
1206
1207 * ld.c (parse_option): Handle -z ignore like --as-needed and
1208 -z record like --no-as-needed.
1209 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
1210 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
1211 looping over DSOs. When deciding about adding DT_NEEDED entries
1212 use ->as_needed instead of ignore_unused_dsos.
1213
Ulrich Drepper8c56fe32006-05-31 15:50:43 +000012142006-05-31 Ulrich Drepper <drepper@redhat.com>
Ulrich Drepper11b030e2006-05-28 20:28:19 +00001215
Ulrich Drepper8c56fe32006-05-31 15:50:43 +00001216 * ld.c: Recognize --as-needed and --no-as-needed options.
1217 * ld.h (struct usedfile): Add as_needed field.
1218 (struct ld_state): Likewise.
1219 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
1220 the list.
1221 * ldscript.y (filename_id_list): Split to correctly parse all
1222 combinations.
1223 (mark_as_needed): Fix loop.
Ulrich Drepper11b030e2006-05-28 20:28:19 +00001224
Ulrich Drepper697f4db2006-06-10 06:50:47 +000012252006-05-28 Ulrich Drepper <drepper@redhat.com>
1226
1227 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
1228 and colno.
1229
Ulrich Drepper2cb8e732006-05-27 21:57:27 +000012302006-05-27 Ulrich Drepper <drepper@redhat.com>
1231
1232 * readelf.c (handle_relocs_rela): Better notations for addon value.
Ulrich Drepper41a99082006-05-28 00:01:43 +00001233 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
Ulrich Drepper2cb8e732006-05-27 21:57:27 +00001234
Ulrich Drepper82c345d2006-04-04 22:07:54 +000012352006-04-04 Ulrich Drepper <drepper@redhat.com>
1236
1237 * addr2line.c: Update copyright year.
1238 * elfcmp.c: Likewise.
1239 * elflint.c: Likewise.
1240 * findtextrel.c: Likewise.
1241 * ld.c: Likewise.
1242 * nm.c: Likewise.
1243 * objdump.c: Likewise.
1244 * ranlib.c: Likewise.
1245 * readelf.c: Likewise.
1246 * size.c: Likewise.
1247 * strings.c: Likewise.
1248 * strip.c: Likewise.
1249
Roland McGrathdd7e22b2006-03-09 23:05:47 +000012502006-03-09 Roland McGrath <roland@redhat.com>
1251
1252 * Makefile.am (AM_LDFLAGS): New variable.
1253
Roland McGrath060fa052006-03-02 07:51:50 +000012542006-03-01 Roland McGrath <roland@redhat.com>
1255
1256 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
1257 for dwarf.h changes matching 3.0 spec.
1258 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
1259
Ulrich Drepper038129b2005-12-04 16:47:24 +000012602005-12-04 Ulrich Drepper <drepper@redhat.com>
1261
1262 * elflint.c (check_one_reloc): If relocation section is not loaded,
1263 don't check whether the relocations modify read-only sections or
1264 loaded and unloaded sections.
1265
Ulrich Drepper607e0542005-12-04 15:51:06 +000012662005-11-28 Ulrich Drepper <drepper@redhat.com>
1267
1268 * elflint.c (check_one_reloc): Take additional parameters. Use
1269 them to determine whether relocation is valid in this type of
1270 file. DSOs and executables can contain relocation sections in
1271 unloaded sections which just show the relocations the linker
1272 applied. Adjust all callers.
1273 (check_program_header): Check that PT_PHDR is loaded and that offset
1274 matches the one in the ELF header.
1275
Roland McGrath6724c902005-10-28 07:07:19 +000012762005-10-26 Roland McGrath <roland@redhat.com>
1277
1278 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
1279
Ulrich Drepperd0449522005-09-03 07:23:52 +000012802005-09-03 Ulrich Drepper <drepper@redhat.com>
1281
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +00001282 * strip.c (handle_elf): Unify some error messages.
1283 * ld.c (main): Likewise.
1284 * ldgeneric.c (open_elf): Likewise.
1285 * elfcmp.c (main): Likewise.
1286 * elflint.c (check_elf_header): Likewise.
1287
1288 * size.c (process_file): Fix typo in error message.
1289
Ulrich Drepperd0449522005-09-03 07:23:52 +00001290 * readelf.c: Lots of little cleanups. Use _unlocked functions.
1291
Ulrich Dreppera60501e2005-09-02 19:50:17 +000012922005-09-02 Ulrich Drepper <drepper@redhat.com>
1293
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +00001294 * strings.c (main): Reset elfmap variable after munmap call.
Ulrich Drepper618795f2005-09-02 20:01:37 +00001295 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
Ulrich Dreppera60501e2005-09-02 19:50:17 +00001296
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000012972005-08-28 Ulrich Drepper <drepper@redhat.com>
1298
1299 * ranlib.c: Don't define pread_retry and write_retry here.
1300
1301 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
1302 (CLEANFILES): Add *.gcno *.gcda *.gconv.
1303
1304 * strings.c (process_chunk): Reorder expressions in conditional
1305 (process_chunk_mb): Likewise.
1306
1307 * strings.c: New file.
1308 * Makefile.am (bin_PROGRAMS): Add strings.
1309 (strings_no_Wstring): Define.
1310 (strings_LDADD): Define.
1311
Roland McGrath71e15a02005-08-27 10:33:26 +000013122005-08-27 Roland McGrath <roland@redhat.com>
1313
1314 * addr2line.c (dwarf_diename_integrate): Function removed.
1315 (print_dwarf_function): Use plain dwarf_diename.
1316
Ulrich Drepperc5a06cd2005-08-24 19:50:14 +000013172005-08-24 Ulrich Drepper <drepper@redhat.com>
1318
1319 * elflint.c (check_versym): Versioned symbols should not have
1320 local binding.
1321
Ulrich Drepper5d832292005-08-15 21:36:27 +000013222005-08-15 Ulrich Drepper <drepper@redhat.com>
1323
Ulrich Drepper61655e02005-08-16 04:23:02 +00001324 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
1325 undefined.
1326
Ulrich Drepper5d832292005-08-15 21:36:27 +00001327 * Makefile.am: Add rules to build ranlib.
1328 * ranlib.c: New file.
1329
Roland McGrath18e13422005-08-15 08:01:25 +000013302005-08-14 Roland McGrath <roland@redhat.com>
1331
1332 * elflint.c (check_sections): Use ebl_section_type_name and allow any
1333 sh_type it recognizes.
1334
1335 * elflint.c (check_sections): Print unknown flags in hex, don't
1336 truncate high bits. Print section number and name for unknown type.
1337
Roland McGrathf6895042005-08-13 20:56:52 +000013382005-08-13 Roland McGrath <roland@redhat.com>
1339
1340 * elflint.c (check_program_header): Use ebl_segment_type_name and
1341 allow any p_type it recognizes. Include p_type value in error
1342 message for unknown type.
1343
Ulrich Drepperc5c33a62005-08-13 17:50:47 +000013442005-08-13 Ulrich Drepper <drepper@redhat.com>
1345
1346 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
1347 to ebl_check_special_symbol.
1348 (check_sections): Pass ehdr to ebl_bss_plt_p.
1349
Roland McGrath653d3762005-08-13 01:59:10 +000013502005-08-12 Roland McGrath <roland@redhat.com>
1351
1352 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
1353 refers to the right section if it's not SHN_ABS.
1354 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
1355
1356 * elflint.c (check_sections): Don't complain about a non-NOBITS
1357 section taking no segment space, if it's sh_size is 0.
1358
1359 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
1360 be PROGBITS or NOBITS.
1361
1362 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
1363 standard st_value and st_size checks.
1364
Roland McGrath1c83bf12005-08-11 07:03:55 +000013652005-07-28 Roland McGrath <roland@redhat.com>
Ulrich Drepperfaf4d192005-08-11 05:12:05 +00001366
Roland McGrath1c83bf12005-08-11 07:03:55 +00001367 * addr2line.c (options, parse_opt): Don't handle -e here.
1368 (executable): Variable removed.
1369 (argp_children): New static variable.
1370 (argp): Use it. Make const.
1371 (main): Fill in argp_children from dwfl_standard_argp ().
1372 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1373 (print_dwarf_function): New function. Try to figure out inline chain.
1374 (elf_getname): Function removed, libdwfl does it for us.
1375 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1376 Use dwfl_module_addrname instead of elf_getname.
1377 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1378 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1379
13802005-08-10 Ulrich Drepper <drepper@redhat.com>
1381
1382 * strip.c (parse_opt): STATE parameter is now used.
1383 Various little cleanups.
1384
1385 * readelf.c (print_debug_line_section): Correct fallout of renaming
1386 of DW_LNS_set_epilog_begin.
Ulrich Drepper6d5c3bd2005-08-11 04:37:52 +00001387
Roland McGrath8f31c2c2005-08-09 04:58:05 +000013882005-08-08 Roland McGrath <roland@redhat.com>
1389
1390 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1391 with binutils strip. Likewise -d, -S, as aliases for -g.
1392 Likewise ignore -s/--strip-all.
1393
Roland McGrath095a01b2005-08-08 03:49:35 +000013942005-08-07 Roland McGrath <roland@redhat.com>
1395
1396 * strip.c (process_file): Open read-only when using a different output
1397 file.
1398
Ulrich Drepper47be7952005-08-07 04:41:39 +000013992005-08-06 Ulrich Drepper <drepper@redhat.com>
1400
Ulrich Drepper637963b2005-08-07 05:33:07 +00001401 * elflint.c (in_nobits_scn): New function.
1402 (check_versym): Allow references for defined symbols against versions
1403 of other DSOs also for symbols in nobits sections.
1404 Move a few variables around.
1405
Ulrich Drepper47be7952005-08-07 04:41:39 +00001406 * Makefile.am (AM_CFLAGS): Avoid duplication.
1407 Link with statis libs if BUILD_STATIC.
1408
Ulrich Drepperdbace232005-08-06 01:37:23 +000014092005-08-05 Ulrich Drepper <drepper@redhat.com>
1410
1411 * elflint.c: Many, many more tests. Mostly related to symbol
1412 versioning. Those sections should now be completely checked.
1413
1414 * readelf.c (print_dynamic): Use gelf_offscn.
1415
Ulrich Drepperacb89832005-08-04 07:01:49 +000014162005-08-04 Ulrich Drepper <drepper@redhat.com>
1417
1418 * elflint.c: Add lots more tests: more extension symbol table sanity,
1419 versioning section tests, hash table tests. General cleanup.
1420
Ulrich Drepperc911c9e2005-08-02 16:07:42 +000014212005-08-02 Ulrich Drepper <drepper@redhat.com>
1422
Ulrich Drepper8a687742005-08-03 02:24:12 +00001423 * objdump.c: New file.
1424 * Makefile.am (bin_PROGRAMS): Add objdump.
1425 (objdump_LDADD): Define.
1426
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001427 * elflint.c (check_reloc_shdr): New function split out from check_rela
1428 and check_rel.
1429 (check_one_reloc): New function. Likewise.
1430 (check_rela): Use check_reloc_shdr and check_one_reloc.
1431 (check_rel): Likewise.
Ulrich Drepper41de4882005-08-03 00:02:56 +00001432 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
1433 section.
1434 Add checks that relocations against read-only segments are flagged,
1435 that the text relocation flag is not set unnecessarily, and that
1436 relocations in one section are either against loaded or not-loaded
1437 segments.
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001438
Ulrich Drepper8533dcf2005-08-01 07:18:47 +000014392005-08-01 Ulrich Drepper <drepper@redhat.com>
1440
1441 * elfcmp.c (main): Ignore section count and section name string table
1442 section index.
1443
Roland McGrathf9ece8a2005-07-28 07:03:04 +000014442005-07-27 Roland McGrath <roland@redhat.com>
1445
1446 * elfcmp.c: Include <locale.h>.
1447
Ulrich Drepper7d48d6a2005-07-27 10:13:23 +000014482005-07-27 Ulrich Drepper <drepper@redhat.com>
1449
1450 * elfcmp.c: Print name and index of differing section.
1451
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000014522005-07-24 Ulrich Drepper <drepper@redhat.com>
1453
1454 * elfcmp.c: Implement comparing gaps between sections.
1455
14562005-07-23 Ulrich Drepper <drepper@redhat.com>
1457
1458 * elflint.c: Include libeblP.h instead of libebl.h.
1459 * nm.c: Likewise.
1460 * readelf.c: Likewise.
1461 * elfcmp.c: Likewise.
1462
1463 * elfcmp.c (main): Compare individual ELF header fields, excluding
1464 e_shoff instead of the whole struct at once.
1465 Use ebl_section_strip_p instead of SECTION_STRIP_P.
1466 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
1467
14682005-07-22 Ulrich Drepper <drepper@redhat.com>
1469
1470 * elfcmp.c (main): Take empty section into account when comparing
1471 section content.
1472
1473 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
1474 using it.
1475
14762005-07-21 Ulrich Drepper <drepper@redhat.com>
1477
1478 * elfcmp.c: New file.
1479 * Makefile.am (bin_PROGRAMS): Add elfcmp.
1480 (elfcmp_LDADD): Define.
1481
1482 * elflint.c (check_rela): Check that copy relocations only reference
1483 object symbols or symbols with unknown type.
1484 (check_rel): Likewise.
1485
14862005-06-08 Roland McGrath <roland@redhat.com>
1487
1488 * readelf.c (print_ops): Add consts.
1489
14902005-05-31 Roland McGrath <roland@redhat.com>
1491
1492 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
1493 abbreviations. Print a header line before each CU section.
1494
1495 * readelf.c (print_debug_loc_section): Fix indentation for larger
1496 address size.
1497
14982005-05-30 Roland McGrath <roland@redhat.com>
1499
1500 * readelf.c (print_debug_line_section): Print section offset of each
1501 CU's table, so they are easy to find from seeing the stmt_list value.
1502
1503 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
1504 (attr_callback): Grok DW_AT_ranges and print offset in hex.
1505
1506 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
1507 (print_debug_ranges_section, print_debug_loc_section): Likewise.
1508
1509 * readelf.c (print_ops): Take different args for indentation control.
1510 (attr_callback): Caller updated.
1511 Grok several more block-form attributes as being location expressions.
1512 For those same attributes with udata forms, format output differently
1513 for location list offset.
1514 (print_debug_loc_section): Implement it for real.
1515
1516 * readelf.c (options): Mention ranges for --debug-dump.
1517 (enum section_e): Add section_ranges.
1518 (parse_opt): Grok "ranges" for -w/--debug-dump.
1519 (print_debug_ranges_section): New function.
1520 (print_debug): Handle .debug_ranges section.
1521
15222005-05-30 Ulrich Drepper <drepper@redhat.com>
1523
1524 * readelf.c (handle_notes): At least x86-64 need not have the note
1525 section values aligned to 8 bytes.
1526
15272005-05-18 Ulrich Drepper <drepper@redhat.com>
1528
1529 * readelf.c (dwarf_tag_string): Add new tags.
1530
15312005-05-08 Roland McGrath <roland@redhat.com>
1532
1533 * strip.c (handle_elf): Don't translate hash and versym data formats,
1534 elf_getdata already did it for us.
1535
15362005-05-07 Ulrich Drepper <drepper@redhat.com>
1537
1538 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
1539 (addr2line_LDADD): Likewise.
1540
15412005-05-03 Roland McGrath <roland@redhat.com>
1542
1543 * strip.c (handle_elf): Apply symbol table fixups to discarded
1544 relocation sections when they are being saved in the debug file.
1545
1546 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
1547 and gelf_xlatetof, not the native byte order.
1548
1549 * strip.c (parse_opt): Give error if -f or -o is repeated.
1550 (main): Exit if argp_parse returns nonzero.
1551
1552 * strip.c (debug_fname_embed): New variable.
1553 (options, parse_opt): New option -F to set it.
1554
15552005-05-07 Ulrich Drepper <drepper@redhat.com>
1556
1557 * readelf.c (parse_opt): Make any_control_option variable
1558 local. Simplify some tests.
1559
15602005-05-03 Roland McGrath <roland@redhat.com>
1561
1562 * strip.c (crc32_file): Function removed (now in ../lib).
1563
15642005-05-03 Roland McGrath <roland@redhat.com>
1565
1566 * elflint.c (is_debuginfo): New variable.
1567 (options, parse_opt): New option --debuginfo/-d to set it.
1568 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
1569 (check_note): If is_debuginfo, don't try to get note contents.
1570
15712005-04-24 Ulrich Drepper <drepper@redhat.com>
1572
1573 * readelf.c (print_debug_abbrev_section): Don't print error when end of
1574 section reached.
1575
15762005-04-14 Ulrich Drepper <drepper@redhat.com>
1577
1578 * readelf.c (dwarf_encoding_string): New function.
1579 (dwarf_inline_string): New function.
1580 (dwarf_access_string): New function.
1581 (dwarf_visibility_string): New function.
1582 (dwarf_virtuality_string): New function.
1583 (dwarf_identifier_case_string): New function.
1584 (dwarf_calling_convention_string): New function.
1585 (dwarf_ordering_string): New function.
1586 (dwarf_discr_list_string): New function.
1587 (attr_callback): Decode man more attribute values.
1588
15892005-04-01 Ulrich Drepper <drepper@redhat.com>
1590
1591 * addr2line.c: Finish implementation of -f option.
1592
15932005-03-29 Ulrich Drepper <drepper@redhat.com>
1594
1595 * addr2line.c: New file.
1596 * Makefile.am (bin_PROGRAMS): Add addr2line.
1597 Define addr2line_LDADD.
1598
1599 * findtextrel.c: Use new dwarf_addrdie function.
1600
1601 * findtextrel.c: Fix usage message and re-add accidentally removed
1602 line.
1603
16042005-03-28 Ulrich Drepper <drepper@redhat.com>
1605
1606 * findtextrel.c: New file.
1607 * Makefile: Add rules to build findtextrel.
1608
16092005-02-15 Ulrich Drepper <drepper@redhat.com>
1610
1611 * ldlex.l: Provide ECHO definition to avoid warning.
1612
1613 * elflint.c (check_program_header): Fix typo in RELRO test.
1614
1615 * Makefile.am (AM_CFLAGS): Add more warning options.
1616 * elflint.c: Fix warnings introduced by the new warning options.
1617 * i386_ld.c: Likewise.
1618 * ld.c: Likewise.
1619 * ld.h: Likewise.
1620 * ldgeneric.c: Likewise.
1621 * nm.c: Likewise.
1622 * readelf.c: Likewise.
1623 * sectionhash.c: Likewise.
1624 * size.c: Likewise.
1625 * string.c: Likewise.
1626
16272005-02-05 Ulrich Drepper <drepper@redhat.com>
1628
1629 * Makefile.am: Check for text relocations in constructed DSOs.
1630
1631 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
1632 with -lmudflap.
1633
1634 * ldscript.y: Add as_needed handling.
1635 * ldlex.l: Recognize AS_NEEDED token.
1636 * ld.h (struct filename_list): Add as_needed flag.
1637
16382005-02-04 Ulrich Drepper <drepper@redhat.com>
1639
1640 * elflint.c (check_symtab): Correctly determine size of GOT section.
1641
16422005-01-19 Ulrich Drepper <drepper@redhat.com>
1643
1644 * ld.c: Remove unnecessary more_help function. Print bug report
1645 address using argp.
1646 * strip.c: Likewise.
1647 * size.c: Likewise.
1648 * nm.c: Likewise.
1649 * readelf.c: Likewise.
1650 * elflint.c: Likewise.
1651
1652 * elflint.c (main): Don't check for parameter problems here.
1653 (parse_opt): Do it here, where we get informed about some of them
1654 anyway.
1655
1656 * readelf.c (main): Don't check for parameter problems here.
1657 (parse_opt): Do it here, where we get informed about some of them
1658 anyway.
1659
16602005-01-11 Ulrich Drepper <drepper@redhat.com>
1661
1662 * strip.c: Update copyright year.
1663 * readelf.c: Likewise.
1664 * size.c: Likewise.
1665 * nm.c: Likewise.
1666 * ld.c: Likewise.
1667 * elflint.c: Likewise.
1668
1669 * elflint.c (check_symtab): Don't warn about wrong size for
1670 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
1671
16722004-10-05 Ulrich Drepper <drepper@redhat.com>
1673
1674 * readelf.c (print_phdr): In section mapping, also indicate
1675 sections in read-only segments.
1676
16772004-09-25 Ulrich Drepper <drepper@redhat.com>
1678
1679 * readelf.c: Make compile with gcc 4.0.
1680 * strip.c: Likewise.
1681
16822004-08-16 Ulrich Drepper <drepper@redhat.com>
1683
1684 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
1685 allocate to work around gcc 3.4 bug.
1686
16872004-01-25 Ulrich Drepper <drepper@redhat.com>
1688
1689 * ldlex.l (invalid_char): Better error message.
1690
16912004-01-23 Ulrich Drepper <drepper@redhat.com>
1692
1693 * readelf.c: Print SHT_GNU_LIBLIST sections.
1694
1695 * none_ld.c: New file.
1696
16972004-01-21 Ulrich Drepper <drepper@redhat.com>
1698
1699 * Makefile.am: Enable building of machine specific linker.
1700
17012004-01-20 Ulrich Drepper <drepper@redhat.com>
1702
1703 * Makefile.am: Support building with mudflap.
1704
1705 * i386_ld.c: Fix warnings gcc 3.4 spits out.
1706 * ldgeneric.c: Likewise.
1707 * ldscript.y: Likewise.
1708 * readelf.c: Likewise.
1709 * strip.c: Likewise.
1710
1711 * readelf.c (print_debug_line_section): Determine address size
1712 correctly.
1713
17142004-01-19 Ulrich Drepper <drepper@redhat.com>
1715
1716 * readelf.c (print_phdr): Show which sections are covered by the
1717 PT_GNU_RELRO entry.
1718
1719 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
1720
1721 * readelf.c (print_debug_macinfo_section): Implement.
1722
17232004-01-18 Ulrich Drepper <drepper@redhat.com>
1724
1725 * readelf.c (print_debug_line_section): Implement.
1726
17272004-01-17 Ulrich Drepper <drepper@redhat.com>
1728
1729 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
1730 * src/ld.c: Likewise.
1731 * src/nm.c: Likewise.
1732 * src/readelf.c: Likewise.
1733 * src/size.c: Likewise.
1734 * src/strip.c: Likewise.
1735
1736 * strip.c: Add a few more unlikely. Reduce scope of some variables.
1737
1738 * Makefile.am: Support building with mudflap.
1739
17402004-01-16 Ulrich Drepper <drepper@redhat.com>
1741
1742 * readelf.c (print_debug_info_section): Free dies memory.
1743
1744 * readelf.c: Print .debug_info section content.
1745
17462004-01-13 Ulrich Drepper <drepper@redhat.com>
1747
1748 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
1749
17502004-01-12 Ulrich Drepper <drepper@redhat.com>
1751
1752 * readelf.c (print_debug_aranges): Implement using libdw.
1753
17542004-01-11 Ulrich Drepper <drepper@redhat.com>
1755
1756 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
1757
1758 * readelf.c: Use libdw instead of libdwarf. Not all of the old
1759 behavior is available yet.
1760 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
1761
17622004-01-09 Ulrich Drepper <drepper@redhat.com>
1763
1764 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
1765
1766 * nm.c: Implement getting information about local variables.
1767
17682004-01-07 Ulrich Drepper <drepper@redhat.com>
1769
1770 * nm.c: Read also debug information for local symbols.
1771
17722004-01-05 Ulrich Drepper <drepper@redhat.com>
1773
1774 * nm.c: Shuffle dwarf handling code around so the maximum column
1775 width can be computed ahead of printing. Avoid collection symbols
1776 which are not printed anyway.
1777
1778 * nm.c: Rewrite dwarf handling to use libdw.
1779 * Makefile.am (AM_CFLAGS): Add -std parameter.
1780 (INCLUDES): Find header in libdw subdir.
1781 (nm_LDADD): Replace libdwarf with libdw.
1782
1783 * elflint.c: Update copyright year.
1784 * readelf.c: Likewise.
1785 * size.c: Likewise.
1786 * strip.c: Likewise.
1787 * nm.c: Likewise.
1788
17892003-12-31 Ulrich Drepper <drepper@redhat.com>
1790
1791 * strip.c (process_file): Close file before returning.
1792
17932003-11-19 Ulrich Drepper <drepper@redhat.com>
1794
1795 * readelf.c (handle_dynamic): Make column for tag name wider.
1796
17972003-09-29 Ulrich Drepper <drepper@redhat.com>
1798
1799 * readelf.c (handle_dynamic): Always terminate tag name with a space.
1800
18012003-09-25 Ulrich Drepper <drepper@redhat.com>
1802
1803 * strip.c (process_file): Don't mmap the input file, we modify the
1804 data structures and don't want the change end up on disk.
1805
18062003-09-23 Jakub Jelinek <jakub@redhat.com>
1807
1808 * unaligned.h (union u_2ubyte_unaligned,
1809 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
1810 packed attribute.
1811 (add_2ubyte_unaligned, add_4ubyte_unaligned,
1812 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
1813 Read/store value through _ptr->u instead of *_ptr.
1814
18152003-09-22 Ulrich Drepper <drepper@redhat.com>
1816
1817 * size.c (show_sysv): Change type of maxlen to int.
1818
1819 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
1820 buckets.
1821
1822 * i386_ld.c: Many many fixes and extensions.
1823 * ld.c: Likewise.
1824 * ldgeneric.c: Likewise.
1825
18262003-08-16 Ulrich Drepper <drepper@redhat.com>
1827
1828 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
1829 the reference is from another DSO.
1830
18312003-08-15 Ulrich Drepper <drepper@redhat.com>
1832
1833 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
1834 point is found when creating a DSO.
1835
18362003-08-14 Ulrich Drepper <drepper@redhat.com>
1837
1838 * ld.c (main): Always call FLAG_UNRESOLVED.
1839 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
1840 undefined symbols if not creating DSO or ld_state.nodefs is not set.
1841
18422003-08-13 Ulrich Drepper <drepper@redhat.com>
1843
1844 * Makefile.in: Depend on libebl.a, not libebl.so.
1845
1846 * ld.c (main): Mark stream for linker script as locked by caller.
1847 (read_version_script): Likewise.
1848 * ldlex.c: Define fread and fwrite to _unlocked variant.
1849
1850 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
1851 target_bswap_32.
1852 * unaligned.h: Define target_bswap_16, target_bswap_32, and
1853 target_bswap_64.
1854 (store_2ubyte_unaligned, store_4ubyte_unaligned,
1855 store_8ubyte_unaligned): Define using new macros.
1856
18572003-08-12 Ulrich Drepper <drepper@redhat.com>
1858
1859 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
1860 possibly unaligned memory. Support use of big endian machines.
1861
18622003-08-11 Ulrich Drepper <drepper@redhat.com>
1863
1864 * Moved to CVS archive.