blob: ab33cbf2002fac54cddc15e1a0527cdc0d39bc62 [file] [log] [blame]
Roland McGrath3b1b6512010-06-04 02:26:30 -070012010-06-04 Roland McGrath <roland@redhat.com>
2
Roland McGrathaa32f922010-06-04 02:29:08 -07003 * unstrip.c (update_shdr): New function.
4 (update_sh_size): Call it instead of gelf_update_shdr.
5 (adjust_relocs, add_new_section_symbols): Likewise.
6 (new_shstrtab, copy_elided_sections): Likewise.
7
Roland McGrath3b1b6512010-06-04 02:26:30 -07008 * unstrip.c (copy_elided_sections): Bail if stripped file has more
9 sections than unstripped file, rather than getting confused later.
10
Roland McGrath7a5bed82010-06-01 13:44:00 -0700112010-06-01 Roland McGrath <roland@redhat.com>
12
Roland McGrath7fac1ce2010-06-01 15:56:58 -070013 * readelf.c (dwarf_form_string): Handle DWARF 4 forms.
14 (attr_callback): Handle DW_FORM_flag_present, DW_FORM_exprloc,
Roland McGrathc8a06732010-06-01 19:52:39 -070015 DW_FORM_sec_offset, DW_FORM_ref_sig8.
Roland McGrath7fac1ce2010-06-01 15:56:58 -070016
Roland McGrath7a5bed82010-06-01 13:44:00 -070017 * readelf.c (print_debug): Don't bail if libdw setup fails.
18 Suppress complaint if we only want .eh_frame anyway.
19
Ulrich Drepper173ade82010-05-28 07:39:49 -0700202010-05-28 Ulrich Drepper <drepper@redhat.com>
21
22 * readelf.c (attr_callback): Also print form information.
23
Roland McGrath12e3d1f2010-05-19 18:03:31 -0700242010-05-19 Roland McGrath <roland@redhat.com>
25
26 * addr2line.c (find_symbol): Short-circuit on empty name.
27 (handle_address): Handle SYMBOL with no +OFFSET.
28
Roland McGrath688f7fc2010-05-08 03:22:59 -0700292010-05-08 Roland McGrath <roland@redhat.com>
30
31 * readelf.c (print_ops): Take new arg OFFSET_SIZE.
32 Use that for DW_OP_call_ref, not ADDRSIZE.
33 (print_cfa_program): Update caller.
34 (struct attrcb_args): Add offset_size field.
35 (attr_callback): Use it for print_ops call.
36 (print_debug_info_section): Initialize it.
Roland McGrath50aa8d12010-06-01 11:22:36 -070037
Roland McGrath62b28b62010-04-14 11:54:06 -0700382010-04-14 Roland McGrath <roland@redhat.com>
39
40 * readelf.c (handle_core_item): Fix bitmask printing.
41
Roland McGrath3b495d82010-04-06 12:58:32 -0700422010-04-06 Roland McGrath <roland@redhat.com>
43
44 * ld.c (options): Fix some typos in messages.
45 * elflint.c (check_scn_group, check_group): Likewise.
46 * ldscript.y (add_id_list): Likewise.
47 * readelf.c (print_hash_info): Add xgettext:no-c-format magic comment
48 before translated string containing a literal %.
49
Roland McGrath890081b2010-02-26 17:57:50 -0800502010-02-26 Roland McGrath <roland@redhat.com>
51
52 * readelf.c (process_file): Don't leak an fd in failure case.
53
Roland McGrathc2b26f12010-02-15 15:16:15 -0800542010-02-15 Roland McGrath <roland@redhat.com>
55
Roland McGrath22359e22010-02-15 15:57:03 -080056 * Makefile.am: Use config/eu.am for common stuff.
57
Roland McGrathc2b26f12010-02-15 15:16:15 -080058 * readelf.c (print_debug_frame_section): Add a cast to avoid sign
59 mismatch in comparison.
60
Roland McGrathf920fd52010-02-02 15:50:15 -0800612010-02-02 Roland McGrath <roland@redhat.com>
62
63 * readelf.c (print_encoding_base): Handle DW_EH_PE_absptr (zero).
64 (read_encoded): Likewise.
65 (print_debug_frame_section): Check for bogus augmentation length.
66 For P augmentation, use read_encoded, print the encoding description,
67 and use hex for unsigned values.
68
Roland McGrathb337b1f2010-01-15 01:02:27 -0800692010-01-15 Roland McGrath <roland@redhat.com>
70
71 * ar.c: Include <sys/stat.h>.
72 * elflint.c: Likewise.
73 * readelf.c: Likewise.
74 * strip.c: Likewise.
75 * unstrip.c: Likewise
76
Roland McGrathbd733ca2010-01-07 20:11:42 -0800772010-01-07 Roland McGrath <roland@redhat.com>
78
Roland McGrath8111da02010-01-07 20:31:59 -080079 * readelf.c (print_ehdr): Handle PN_XNUM.
80 (phnum): New static variable.
81 (process_elf_file): Set it with elf_getphdrnum.
82 (print_phdr): Use phnum instead of EHDR->e_phnum.
83 (print_dynamic, handle_notes): Likewise.
84 (handle_relocs_rel, handle_relocs_rela): Likewise.
85
Roland McGrathbd733ca2010-01-07 20:11:42 -080086 * elfcmp.c (main): Use elf_getshdrnum and elf_getphdrnum.
87
88 * elflint.c (phnum): New static variable.
89 (check_elf_header): Set it, handling PN_XNUM.
90 Use that in place of EHDR->e_phnum throughout.
91 (check_symtab, check_reloc_shdr, check_dynamic): Likewise.
92 (unknown_dependency_p, check_sections, check_program_header): Likewise.
93
Roland McGrath019d9fb2010-01-05 13:36:07 -0800942010-01-05 Roland McGrath <roland@redhat.com>
95
96 * readelf.c (dwarf_attr_string): Match DW_AT_GNU_vector and
97 DW_AT_GNU_template_name.
98
Roland McGrathe4061d02010-01-04 20:25:09 -0800992010-01-04 Roland McGrath <roland@redhat.com>
100
Roland McGrath0ccbbcd2010-01-04 21:59:07 -0800101 * readelf.c (handle_notes_data): Grab NT_AUXV only for name "CORE".
102 (handle_core_note): Pass NHDR and NAME to ebl_core_note.
103 (handle_core_item): Handle .format of '\n' as \n-separated strings.
104
Roland McGrath2e79deb2010-01-04 20:36:10 -0800105 * readelf.c (implicit_debug_sections): New variable.
106 (parse_opt): Set it instead of print_debug_sections for -a.
107 OR them together for print_debug check.
108 (print_debug): OR them together for section check.
109
Roland McGratha7422be2010-01-04 20:29:33 -0800110 * readelf.c (options): Repartition into set implied by -a and others.
111 Correct -a text to match reality.
112
Roland McGrathe4061d02010-01-04 20:25:09 -0800113 * readelf.c (struct section_argument): Add bool member 'implicit'.
114 (parse_opt): Set it for -a cases, clear it for -x args.
115 (for_each_section_argument): Don't complain about a missing section by
116 name if it's implicit.
117
Roland McGrathefa64962009-11-16 01:50:58 -08001182009-11-16 Roland McGrath <roland@redhat.com>
119
120 * readelf.c (print_string_section): Punt SHT_NOBITS like empty
121 sections, just as dump_data_section already does.
122
Mark Wielaardc49d00a2009-09-21 16:47:07 -07001232009-09-21 Ulrich Drepper <drepper@redhat.com>
124
125 * elflint.c (special_sections): Allow MERGE and STRINGS flags to be
126 set for .comment section.
127 Patch by Mark Wielaard <mjw@redhat.com>.
128
Roland McGrathfb33c672009-09-08 00:21:18 -07001292009-09-08 Roland McGrath <roland@redhat.com>
130
131 * ar.c (main): Fix typo in message format.
132
Roland McGrath2d13ea22009-08-21 03:16:32 -07001332009-08-21 Roland McGrath <roland@redhat.com>
134
135 * readelf.c (attr_callback): Use print_block only when we don't use
136 print_ops.
137
Roland McGrath536127f2009-08-14 13:10:09 -07001382009-08-14 Roland McGrath <roland@redhat.com>
139
140 * ar.c (do_oper_extract): Use pathconf instead of statfs.
141
Ulrich Drepper9ccf76a2009-08-01 10:07:24 -07001422009-08-01 Ulrich Drepper <drepper@redhat.com>
143
144 * debugpred.h: Add two most const.
145
Mark Wielaardbc1b92e2009-07-26 08:33:18 -07001462009-07-26 Mark Wielaard <mjw@redhat.com>
147
148 * elflint.c (check_note_data): Recognize NT_GNU_GOLD_VERSION.
149
Mark Wielaard79178202009-07-25 12:44:46 -07001502009-07-25 Mark Wielaard <mjw@redhat.com>
151
152 * Makefile.am (addr2line_LDADD): Add $(libelf).
153
Roland McGrathbe4589d2009-07-24 16:23:12 -07001542009-07-24 Roland McGrath <roland@redhat.com>
155
156 * readelf.c (print_block): New function.
157 (print_ops): Use it.
158 (attr_callback): Use it for DW_FORM_block* forms.
159
Mark Wielaarddaf85b22009-07-24 15:49:51 -07001602009-07-20 Mark Wielaard <mjw@redhat.com>
161
162 * readelf.c (print_ops): Add handling of DW_OP_implicit_value
163 and DW_OP_stack_value.
164
Ulrich Drepper96d950e2009-07-14 10:42:01 -07001652009-07-14 Ulrich Drepper <drepper@redhat.com>
166
167 * elflint.c (check_elf_header): Allow Linux ABI.
168 (check_symtab): Handle STB_GNU_UNIQUE.
169
Mark Wielaardf735db12009-07-08 19:18:53 +02001702009-07-08 Mark Wielaard <mjw@redhat.com>
171
172 * readelf.c (attr_callback): Handle DW_Form constants for
173 DW_AT_data_member_location.
174
Roland McGrathdffc33d2009-07-06 16:06:41 -07001752009-07-06 Roland McGrath <roland@redhat.com>
176
177 * readelf.c (register_info): New function. Handle unknown register #s.
178 (print_cfa_program): Use it.
179 (handle_core_register, handle_core_registers): Likewise.
180
Roland McGrath5dbccdb2009-06-28 14:48:02 -07001812009-06-28 Roland McGrath <roland@redhat.com>
182
183 * readelf.c (print_address_names): New static variable.
184 (options, parse_opt): Grok -N/--numeric-addresses to clear it.
185 (format_dwarf_addr): Don't look up name if !print_address_names.
186
Ulrich Drepperf1894932009-06-13 15:55:42 -07001872009-06-13 Ulrich Drepper <drepper@redhat.com>
188
189 * ldgeneric.c: Don't use deprecated libelf functions.
190 * nm.c: Likewise.
191 * objdump.c: Likewise.
192 * readelf.c: Likewise.
193 * size.c: Likewise.
194 * strip.c: Likewise.
195 * unstrip.c: Likewise.
196 * ld.h: Fix up comment.
197
Ulrich Drepperb47d2902009-06-01 07:38:32 -07001982009-06-01 Ulrich Drepper <drepper@redhat.com>
199
200 * readelf.c (print_relocs): Expect ELF header argument and pass on
201 to handle_relocs_rel* functions. Adjust caller.
202 (handle_relocs_rel): Add ELF header argument. Add special case for
203 the IRELATIVE relocations in statically linked executables.
204 (handle_relocs_rela): Likewise.
205
Roland McGrathdb19f0b2009-05-07 18:44:27 -07002062009-04-29 Ulrich Drepper <drepper@redhat.com>
207
208 * elflint.c (check_symtab): Add tests of st_other field.
209
Ulrich Drepperaab90f92009-04-23 07:44:36 -07002102009-04-23 Ulrich Drepper <drepper@redhat.com>
211
212 * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
213
Roland McGrathd86e1832009-04-20 00:49:33 -07002142009-04-20 Roland McGrath <roland@redhat.com>
215
Roland McGrath8a592412009-04-20 01:20:44 -0700216 * addr2line.c (print_dwarf_function): Honor -s and -A for file names
217 of inline call sites.
218
Roland McGrathd86e1832009-04-20 00:49:33 -0700219 * addr2line.c (just_section): New variable.
220 (adjust_to_section): New function, broken out of ...
221 (handle_address): ... here.
222 (options, parse_opt): Add -j/--section=NAME to set it.
223
Roland McGrath2fb90512009-04-15 14:47:13 -07002242009-04-15 Roland McGrath <roland@redhat.com>
225
226 * readelf.c (print_debug_frame_section): Check for DW_CIE_ID_64 in
227 64-bit format header, DW_CIE_ID_32 in 32-bit format header.
228
Roland McGrath04a14162009-04-14 01:02:17 -07002292009-04-14 Roland McGrath <roland@redhat.com>
230
Roland McGratheb9ba472009-04-14 18:44:45 -0700231 * readelf.c (print_attributes): Treat SHT_ARM_ATTRIBUTES on EM_ARM
232 like SHT_GNU_ATTRIBUTES.
233
Roland McGrath94f43832009-04-14 04:39:32 -0700234 * readelf.c (handle_core_registers): Fix error message.
235
Roland McGrath04a14162009-04-14 01:02:17 -0700236 * strip.c (handle_elf: check_preserved): Don't note any change when
237 .debug_data is already filled from a previous pass.
238
Ulrich Drepper411cdb22009-02-05 22:04:26 -08002392009-02-05 Ulrich Drepper <drepper@redhat.com>
240
Ulrich Drepper51b3f472009-02-05 22:10:39 -0800241 * objdump.c (show_relocs_x): Minor cleanups.
242
Ulrich Drepper411cdb22009-02-05 22:04:26 -0800243 * readelf.c (print_cfa_program): Correct a few labels.
Ulrich Drepper973a9c72009-02-05 22:56:39 -0800244 Print first DW_CFA_expression and DW_CFA_val_expression parameter
245 as register.
Ulrich Drepper411cdb22009-02-05 22:04:26 -0800246
Ulrich Drepper5ee720c2009-02-01 16:18:18 -08002472009-02-01 Ulrich Drepper <drepper@redhat.com>
248
Ulrich Drepper95fa15e2009-02-01 19:06:10 -0800249 * objdump.c (show_relocs_rel, show_relocs_rela): Split common parts
250 into ...
251 (show_relocs_x): ...here. New function.
Ulrich Drepperf44f0ce2009-02-01 21:31:26 -0800252 (show_relocs): Better spacing in output.
Ulrich Drepper95fa15e2009-02-01 19:06:10 -0800253
Ulrich Dreppercbb422e2009-02-01 18:18:55 -0800254 * objdump.c (show_relocs_rela): Show offsets as signed values.
255
Ulrich Drepper5ee720c2009-02-01 16:18:18 -0800256 * ar.c (main): Fix recognition of invalid modes for a, b, i modifiers.
257 Improve some error messages.
258 Use program_invocation_short_name instead of AR macro.
259 * Makefile.am (CFLAGS_ar): Remove.
260 * elflint.c (parse_opt): ARGP_HELP_EXIT_ERR does nothing for argp_help.
261 * objdump.c (parse_opt): Likewise.
262 * readelf.c (parse_opt): Likewise.
263
Roland McGrath51f01282009-01-27 17:08:03 -08002642009-01-27 Roland McGrath <roland@redhat.com>
265
266 * readelf.c (print_ops): Notice short length, don't overrun buffer
267 (still need to fix LEB128).
268
269 * readelf.c (print_ops): Fix DW_OP_call[24] decoding.
270
271 * readelf.c (print_ops): Print (empty)\n when LEN == 0.
272
Ulrich Drepper62c46532009-01-24 17:01:08 -08002732009-01-24 Ulrich Drepper <drepper@redhat.com>
274
275 * readelf.c (print_debug_frame_section): Fix computation of vma_base
276 for PC-relative mode.
277
Ulrich Drepperd7285e12009-01-23 16:10:44 -08002782009-01-23 Ulrich Drepper <drepper@redhat.com>
279
Ulrich Drepperccccab02009-01-23 16:32:21 -0800280 * size.c (process_file): When handling archive, close file descriptor
281 here. For unknown file format also close file descriptor.
282 (handle_ar): Don't close file descriptor here.
283
Ulrich Drepperd7285e12009-01-23 16:10:44 -0800284 * readelf.c (parse_opt): Move code to add to dump_data_sections and
285 string_sections list in local function add_dump_section. Adjust 'x'
286 key handling. For 'a' key add .strtab, .dynstr, and .comment section
287 to string_sections list.
288
Roland McGrathe9de9b42009-01-22 13:05:40 -08002892009-01-22 Roland McGrath <roland@redhat.com>
290
Roland McGrath9a847e12009-01-22 19:55:00 -0800291 * readelf.c (print_phdr): Don't print section mapping when no sections.
292
Roland McGrathd759aa62009-01-22 19:17:07 -0800293 * Makefile.am (AM_CFLAGS): Pass -Wno-format for *_no_Wformat.
294
Roland McGrathcabeeee2009-01-22 13:17:45 -0800295 * readelf.c (print_debug_frame_section): Initialize IS_SIGNED to false
296 and reset it only for the 'true' cases.
297
298 * Makefile.am (addr2line_no_Wformat): New variable.
299
Roland McGrathe9de9b42009-01-22 13:05:40 -0800300 * readelf.c (print_debug_frame_section): Use t instead of j formats
301 for ptrdiff_t OFFSET.
302
Ulrich Drepperdaf0fda2009-01-21 13:05:36 -08003032009-01-21 Ulrich Drepper <drepper@redhat.com>
304
305 * elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
Ulrich Drepperf93ee8d2009-01-21 15:02:03 -0800306 test. Handle debuginfo files.
Ulrich Drepperdaf0fda2009-01-21 13:05:36 -0800307 (check_exception_data): First sanity test.
308
Ulrich Drepperfdc93e12009-01-17 11:47:10 -08003092009-01-17 Ulrich Drepper <drepper@redhat.com>
310
Ulrich Drepper935edde2009-01-17 16:06:42 -0800311 * readelf.c (print_debug_exception_table): Show target of ar_disp
312 field.
313
314 * elflint.c (check_program_header): Add most consistency checks for
315 PT_GNU_EH_FRAME entry.
316
Ulrich Drepperfdc93e12009-01-17 11:47:10 -0800317 * addr2line.c: Use ARGP_PROGRAM_VERSION_HOOK_DEF and
318 ARGP_PROGRAM_BUG_ADDRESS_DEF.
319 * ar.c: Likewise.
320 * elfcmp.c: Likewise.
321 * elflint.c: Likewise.
322 * findtextrel.c: Likewise.
323 * ld.c: Likewise.
324 * nm.c: Likewise.
325 * objdump.c: Likewise.
326 * ranlib.c: Likewise.
327 * readelf.c: Likewise.
Ulrich Drepper935edde2009-01-17 16:06:42 -0800328
Ulrich Drepperfdc93e12009-01-17 11:47:10 -0800329 * size.c: Likewise.
330 * strings.c: Likewise.
331 * strip.c: Likewise.
332 * unstrip.c: Likewise.
333
Ulrich Drepperb006fbf2009-01-16 03:08:25 -08003342009-01-16 Ulrich Drepper <drepper@redhat.com>
335
Ulrich Drepper3a52c7a2009-01-16 21:11:49 -0800336 * elflint.c (check_program_header): Check that PT_GNU_EH_FRAME entry
337 matches .eh_frame_hdr section, if it is available. Also check that
338 the segment is allocated, not writable, not executable.
339
Ulrich Drepperb006fbf2009-01-16 03:08:25 -0800340 * readelf.c: Add -e option. Dump exception and unwind related
341 sections. Add -e to -a.
Ulrich Drepper05d2b202009-01-16 17:58:54 -0800342 (print_encoding_base): Handle DW_EH_PE_omit.
Ulrich Drepperb006fbf2009-01-16 03:08:25 -0800343 (print_debug_exception_table): Beginning of support.
344 (print_debug): Hook up print_debug_exception_table for
345 .gcc_except_table sections.
346
347 * readelf.c (print_debug_frame_section): Some fixes for last change.
348
Ulrich Drepper351bf202009-01-15 20:18:40 -08003492009-01-15 Ulrich Drepper <drepper@redhat.com>
350
351 * readelf.c (print_encoding): Now a toplevel function.
352 (print_relinfo): Likewise.
353 (print_encoding_base): Broken out of print_debug_frame_section.
354 (print_debug_frame_section): Print different header for .eh_frame
355 sections. Fix recognition of matching CIEs in .debug_frame sections.
356 Print absolute offset for PC-relative FDE locations. Don't print
357 table header for FDEs if the table is empty.
358 (read_encoded): New function.
359 (print_debug_frame_hdr_section): New function.
360 (print_debug): Hook up print_debug_frame_hdr_section for .eh_frame_hdr
361 sections.
362
363 * readelf.c (handle_relocs_rel): Print section number.
364 (print_debug_abbrev_section): Likewise.
365 (print_debug_aranges_section): Likewise.
366 (print_debug_ranges_section): Likewise.
367 (print_debug_info_section): Likewise.
368 (print_debug_line_section): Likewise.
369 (print_debug_loc_section): Likewise.
370 (print_debug_macinfo_section): Likewise.
371 (print_debug_pubnames_section): Likewise.
372 (print_debug_str_section): Likewise.
373
Ulrich Drepper8b394632009-01-10 18:29:56 -08003742009-01-10 Ulrich Drepper <drepper@redhat.com>
375
376 * strings.c (read_block): Fix typo in error message string.
377
Ulrich Drepper87cf5832009-01-07 20:39:21 -08003782009-01-07 Ulrich Drepper <drepper@redhat.com>
379
380 * ld.c (ld_new_searchdir): Fix adding to search path list.
381
Ulrich Drepperac194d02009-01-06 00:30:01 -08003822009-01-06 Ulrich Drepper <drepper@redhat.com>
383
384 * readelf.c: Implement call frame debug section dumping.
Roland McGrathe9243e62009-01-21 18:54:20 -0800385
Roland McGrath3614d992009-01-05 18:05:32 -08003862009-01-05 Roland McGrath <roland@redhat.com>
387
388 * elfcmp.c: Exit with status 2 for errors (like cmp, diff, grep).
389 Status 1 (aka EXIT_FAILURE) is only for completed OK but not equal.
Ulrich Drepperac194d02009-01-06 00:30:01 -0800390
Ulrich Drepper44173ed2009-01-01 19:00:41 -08003912009-01-01 Ulrich Drepper <drepper@redhat.com>
392
393 * addr2line.c: Update copyright year.
394 * ar.c: Likewise.
395 * elfcmp.c: Likewise.
396 * elflint.c: Likewise.
397 * findtextrel.c: Likewise.
398 * ld.c: Likewise.
399 * nm.c: Likewise.
400 * objdump.c: Likewise.
401 * ranlib.c: Likewise.
402 * readelf.c: Likewise.
403 * size.c: Likewise.
404 * strings.c: Likewise.
405 * strip.c: Likewise.
406 * unstrip.c: Likewise.
407
Roland McGrath468fe4d2008-12-11 21:00:12 -08004082008-12-11 Roland McGrath <roland@redhat.com>
409
410 * nm.c (sym_name): New function.
411 (show_symbols_sysv): Use it in place of elf_strptr.
412 (show_symbols_bsd, show_symbols_posix): Likewise.
413 Fixes RHBZ#476136.
414
415 * nm.c (show_symbols_sysv): Use an alloca'd backup section name when
416 elf_strptr fails.
417
Roland McGratha845f682008-12-03 03:41:58 +00004182008-12-02 Roland McGrath <roland@redhat.com>
419
420 * readelf.c (count_dwflmod, process_file): Don't presume encoding of
421 nonzero OFFSET argument to dwfl_getmodules.
422
Roland McGrath1d8bb252008-08-07 08:39:41 +00004232008-08-07 Roland McGrath <roland@redhat.com>
424
425 * addr2line.c (main): Pass string to handle_address.
426 (see_one_module): New function, subroutine of handle_address.
427 (find_symbol): Likewise.
428 (handle_address): Take string argument rather than address.
429 Convert plain number, or handle strings like "(section)+offset"
430 or "symbol+offset".
431
4322008-08-01 Roland McGrath <roland@redhat.com>
433
434 * readelf.c (handle_core_item): Handle 'B' type for 1-origin bitset.
435 For 'b' and 'B', print <x-y,z> or ~<x,y-z> rather than 1/0 string.
436
437 * readelf.c (convert): Take new argument SIZE.
438 (handle_core_register, handle_core_item): Update callers.
439 (handle_core_item): Take new arg REPEATED_SIZE.
440 (handle_core_items): Special case for a singleton item,
441 let handle_core_item handle repeats if it wants to.
442
443 * readelf.c (handle_core_items): Give abridged output
444 for identical groups repeated more than twice.
445
4462008-07-04 Roland McGrath <roland@redhat.com>
447
448 * readelf.c (handle_core_items): Handle ELF_T_ADDR.
449
Roland McGrath521c47d2008-04-11 07:01:58 +00004502008-04-10 Roland McGrath <roland@redhat.com>
451
452 * strip.c (handle_elf): Don't keep sections that kept symbol tables
453 refer to. Instead, just be sure to preserve the original symbol
454 table in the debug file so those symbols go with their sections and
455 can be elided from the stripped version of the symbol table.
456
457 * strip.c (handle_elf): When a discarded section kept in the debug
458 file refers to a nondiscard section via sh_link/sh_info, preserve
459 that nondiscarded section unmodified in the debug file as well.
460 Skip adjustment of discarded sections symbol table references when
461 that symbol table is copied in this way.
462
463 * elflint.c (check_symtab): Don't crash from missing symbol names
464 after diagnosing bogus strtab.
465
466 * strip.c (handle_elf): Cosmetic cleanup in special section contents
467 adjustment for symtab changes.
468
Roland McGrath13b69602008-04-01 02:30:05 +00004692008-03-31 Roland McGrath <roland@redhat.com>
470
471 * elflint.c (check_sections): Add checks on SHF_EXECINSTR sections:
472 must be SHT_PROGBITS, must not be SHF_WRITE. Let backend hook
473 excuse a special section.
474
4752008-03-27 Roland McGrath <roland@redhat.com>
476
477 * elflint.c (check_sections): Check that executability and writability
478 of sections is reflected in segment p_flags.
479
Roland McGrathd11f9cb2008-03-26 20:51:59 +00004802008-03-26 Roland McGrath <roland@redhat.com>
481
482 * elflint.c (check_program_header): Accept PT_GNU_RELRO p_flags
483 that matches its PT_LOAD's p_flags &~ PF_W. On sparc, PF_X really
484 is valid in RELRO.
485
Roland McGrath47c5c352008-02-29 10:17:16 +00004862008-02-29 Roland McGrath <roland@redhat.com>
487
488 * readelf.c (print_attributes): Add a cast.
489 * elflint.c (check_attributes): Likewise.
490
491 * unaligned.h (add_8ubyte_unaligned): Cast PTR argument for parity
492 with [UNALIGNED_ACCESS_CLASS == BYTE_ORDER] definition.
493 (add_4ubyte_unaligned, add_2ubyte_unaligned): Likewise.
494
Ulrich Drepper834de6f2008-02-23 06:50:01 +00004952008-02-03 Ulrich Drepper <drepper@redhat.com>
496
497 * i386_ld.c (elf_i386_count_relocations): Implement R_386_TLS_GD
498 when linked into executable.
499 (elf_i386_create_relocations): Likewise.
500
Roland McGrath059c83e2008-02-21 06:19:39 +00005012008-02-20 Roland McGrath <roland@redhat.com>
502
503 * readelf.c (print_attributes): New function.
504 (process_elf_file): Call it under -A.
505
506 * elflint.c (check_attributes): Implement it for real.
507
5082008-02-19 Roland McGrath <roland@redhat.com>
509
510 * elflint.c (special_sections): Handle .gnu.attributes section.
511 (check_sections): Likewise.
512 (check_attributes): New function.
513
5142008-02-10 Roland McGrath <roland@redhat.com>
515
516 * elfcmp.c (main): Ignore sh_offset differences in non-SHF_ALLOC
517 sections and ET_REL files.
518
Ulrich Drepper712d78e2008-02-02 10:01:53 +00005192008-02-02 Ulrich Drepper <drepper@redhat.com>
520
521 * elf32-i386.script: Add .eh_frame_hdr, .tdata, and .tbss sections.
522 * i386_ld.c (elf_i386_count_relocations): Handle R_386_TLS_LDO_32
523 and R_386_TLS_LE.
524 (elf_i386_create_relocations): Likewise.
525 * ld.h (struct ld_state): Add need_tls, tls_start, and tls_tcb
526 elements.
527 * ldgeneric.c (add_section): If TLS section is used, set need_tls flag.
528 (ld_generic_create_outfile): Add PT_TLS entry to program header.
529 Fix generation of PT_GNU_STACK entry.
530
Ulrich Drepperc54785a2008-02-01 18:05:21 +00005312008-02-01 Ulrich Drepper <drepper@redhat.com>
532
Ulrich Drepper7cd1bf72008-02-01 23:52:59 +0000533 * ld.c (replace_args): Prevent loop over replacements if the parameter
534 is only two characters long.
535
Ulrich Drepperc54785a2008-02-01 18:05:21 +0000536 * ld.c: Recognize sha1 argument for --build-id parameter.
537 * ldgeneric.c (create_build_id_section): Handle sha1.
538 (compute_hash_sum): New function. Broken out of compute_build_id.
539 Take hash function and context as parameters.
540 (compute_build_id): Use compute_hash_sum for md5 and the new sha1
541 implementation.
542
Ulrich Drepper89759c72008-01-31 19:44:12 +00005432008-01-31 Ulrich Drepper <drepper@redhat.com>
544
545 * elf32-i386.script: Add .note.ABI-tag and .note.gnu.build-id sections.
546 * ld.c: Recognize --build-id command line parameter.
547 * ld.h: Define scn_dot_note_gnu_build_id.
548 (struct ld_state): Add build_id and buildidscnidx elements.
549 * ldgeneric.c: Implement --build-id command line parameter.
550 * ldlex.l (ID): Recognize - as valid character after the first one.
551
Ulrich Drepper5530ec52008-01-29 10:42:07 +00005522008-01-29 Ulrich Drepper <drepper@redhat.com>
553
Ulrich Drepperb61c4cc2008-01-30 07:16:28 +0000554 * ld.c (replace_args): New function.
555 (main): Use it to rewrite old-style parameters.
556
Ulrich Dreppered9b6cb2008-01-30 06:33:33 +0000557 * elf32-i386.script: Add .gnu.hash section.
558 * ldgeneric.c (optimal_bucket_size): A tiny bit more efficient.
559 (fillin_special_symbol): Initialize st_size.
560 (sortfct_hashval): New function.
561 (create_gnu_hash): New function.
562 (create_hash): New function.
563 (ld_generic_create_outfile): Use the new functions to create the
564 hash tables.
565
Ulrich Drepper5530ec52008-01-29 10:42:07 +0000566 * elflint.c (check_gnu_hash): Fix index value printed in error message.
567
Ulrich Drepper0e864dd2008-01-25 00:18:42 +00005682008-01-24 Ulrich Drepper <drepper@redhat.com>
569
570 * elflint.c (check_group): Check that signature symbol for section
571 group is not an empty string.
572 * ldgeneric.c: Remove magic assignment of indeces in the dynsym
573 section. Start implementation of --hash-style.
574 * i386_ld.c: Likewise.
575 * ld.c: Recognize --hash-style.
576 * ld.h (struct scninfo): Add comdat_group.
577 Add additional parameter to finalize_plt callback.
578
Ulrich Drepper5449a6b2008-01-22 15:49:39 +00005792008-01-22 Ulrich Drepper <drepper@redhat.com>
580
581 * ld.h (struct callbacks): Add initialize_gotplt.
582 (struct scnhead): Add scn_dot_gotplt.
583 (struct ld_state): Add gotpltscnidx.
584 * i386_ld.c (elf_i386_initialize_plt): Minor optimization.
585 (elf_i386_initialize_pltrel): Likewise.
586 (elf_i386_initialize_got): There is now a separate .got.plt, so
587 don't do the PLT-related work here. Initialize d_type.
588 (elf_i386_initialize_gotplt): New function.
589 (elf_i386_plt0): Use ud2a after indirect jump.
590 (elf_i386_pic_plt0_entry): Likewise.
591 (elf_i386_finalize_plt): Reference now .got.plt.
592 (elf_i386_count_relocations): For GOT entries which need no relocation
593 don't bump nrel_got.
594 (elf_i386_create_relocations): Also get .got.plt. Rewrite R-386_GOT32
595 handling for split .got/.got.plt.
596 (elf_i386_ld_init): Initialize callbacks.initialize_gotplt.
597 * elf32-i386.script: Sort sections for security. There are no .got
598 input sections. Add .got.plt.
599 * ldgeneric.c (ld_generic_generate_sections): Add .got.plt section.
600 (ld_generic_create_outfile): Initialize .got.plt section.
601 Use .got.plt address for _GLOBAL_OFFSET_TABLE_ symbol and DT_PLTGOT.
602
Ulrich Drepperd9488292008-01-20 16:43:15 +00006032008-01-19 Ulrich Drepper <drepper@redhat.com>
604
605 * i386_ld.c (elf_i386_count_relocations): PLT relocations for undefined
606 symbols are not carried over into statically linked output files.
607 Add dummy entries for more TLS relocations.
608
609 * ld.c (options): Add long names for -( and -).
610
611 * ldgeneric.c (check_definition): For newly found definitions don't
612 mark section as used if symbol is absolute.
613 (extract_from_archive): Only assign archive sequence number the first
614 time the archive is handled. Update ld_state.last_archive_used
615 if any symbol was used. Remove nround variable.
616 (file_process2): When using symbol from an archive, update
617 ld_state.group_start_archive, ld_state.archives, and
618 ld_state.tailarchives.
619 (ld_generic_file_process): If group is not handled anymore, after
620 freeing ELF handles for the archives, clear ld_state.archives and
621 *nextp. Fix wrong logic in recognizing first iteration of group
622 loop. When clearing flags, also clear ld_state.group_start_archive.
623
Ulrich Drepper5eee1222008-01-11 10:12:18 +00006242008-01-11 Ulrich Drepper <drepper@redhat.com>
625
626 * objdump.c (show_disasm): Adjust disassembler format string for
627 removal of %e.
628
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00006292008-01-04 Roland McGrath <roland@redhat.com>
630
Roland McGrath059c83e2008-02-21 06:19:39 +0000631 * readelf.c (handle_core_items): Take new arg DESCSZ; if nonzero,
632 a size greater than the items cover means multiple sets of items.
633 (handle_core_note): Update caller.
634
6352008-01-04 Roland McGrath <roland@redhat.com>
636
Ulrich Dreppere219f1c2008-01-09 05:49:49 +0000637 * strip.c (handle_elf): Move SHDRIDX defn to silence gcc warning.
638
6392008-01-03 Roland McGrath <roland@redhat.com>
640
641 * ld.h (linked_from_dso_p): Use __attribute__ ((__gnu_inline__)).
642
643 * elflint.c (check_dynamic): Remove duplicate initializer.
644
Ulrich Drepperad024af2008-01-02 17:42:52 +00006452008-01-02 Ulrich Drepper <drepper@redhat.com>
646
647 * addr2line.c: Update copyright year.
648 * ar.c: Likewise.
649 * elfcmp.c: Likewise.
650 * elflint.c: Likewise.
651 * findtextrel.c: Likewise.
652 * ld.c: Likewise.
653 * nm.c: Likewise.
654 * objdump.c: Likewise.
655 * ranlib.c: Likewise.
656 * readelf.c: Likewise.
657 * size.c: Likewise.
658 * strings.c: Likewise.
659 * strip.c: Likewise.
660 * unstrip.c: Likewise.
661
Ulrich Drepper3cbdd382008-01-02 17:44:39 +00006622007-12-30 Ulrich Drepper <drepper@redhat.com>
663
664 * objdump (show_disasm): Use %e after third parameter.
665
6662007-12-21 Ulrich Drepper <drepper@redhat.com>
667
668 * strip.c: Fix wrong parenthesis in a few branch predictions.
669 * strings.c: Likewise.
670
6712007-12-20 Ulrich Drepper <drepper@redhat.com>
672
673 * Makefile.am (DEFS): Add DEBUGPRED.
674 * addr2line.c: Include debugpred.h.
675 * ar.c: Likewise.
676 * elfcmp.c: Likewise.
677 * elflint.c: Likewise.
678 * findtextrel.c: Likewise.
679 * nm.c: Likewise.
680 * objdump.c: Likewise.
681 * ranlib.c: Likewise.
682 * readelf.c: Likewise.
683 * size.c: Likewise.
684 * strings.c: Likewise.
685 * strip.c: Likewise.
686 * unstrip.c: Likewise.
687 * debugpred.h: New file.
688
689 * readelf.c (handle_relocs_rel): Use elf_scnshndx.
690 (handle_relocs_rela): Likewise.
691
692 * readelf.c: Add lots of likely/unlikely.
693
694 * elflint.c: Minor cleanups.
695
Roland McGrath1a2e8f42007-12-15 23:39:34 +00006962007-11-19 Roland McGrath <roland@redhat.com>
697
698 * readelf.c (print_ops): Handle all bad op codes gracefully.
699 Print their numbers instead of just ???.
700
Roland McGrath07a696e2007-11-09 22:44:26 +00007012007-11-09 Roland McGrath <roland@redhat.com>
702
703 * readelf.c (attr_callback): Handle DW_AT_data_location.
Roland McGrath1a2e8f42007-12-15 23:39:34 +0000704 Handle block forms to mean a DWARF expression for DW_AT_allocated,
705 DW_AT_associated, DW_AT_bit_size, DW_AT_bit_offset, DW_AT_bit_stride,
706 DW_AT_byte_size, DW_AT_byte_stride, DW_AT_count, DW_AT_lower_bound,
707 DW_AT_upper_bound.
Roland McGrath07a696e2007-11-09 22:44:26 +0000708
Roland McGrathe4c22ea2007-10-23 13:07:39 +00007092007-10-20 Roland McGrath <roland@redhat.com>
710
711 * unstrip.c (options): Update -R description.
712 (struct symbol): Put symbol details a union with a size_t pointer
713 `duplicate'.
714 (compare_symbols_output): Use null ->name as marker for discard
715 symbols, not zero *->map.
716 (copy_elided_sections): Record forwarding pointers for discarded
717 duplicates and fill SYMNDX_MAP elements through them.
718
719 * readelf.c (process_file): Set offline_next_address to 0 at start.
720 (struct process_dwflmod_args): New type.
721 (process_dwflmod): Take args in it, pass fd to process_elf_file.
722 (process_file): Update caller; dup FD for passing to libdwfl.
723 (process_elf_file): Take new arg FD. For ET_REL file when
724 displaying data affected by libdwfl relocation, open a new Elf handle.
725
7262007-10-17 Roland McGrath <roland@redhat.com>
727
728 * readelf.c (print_debug_line_section): For invalid data inside a
729 unit with plausible length, keep printing at the next unit boundary.
730
731 * readelf.c (attr_callback): Use dwarf_formref_die, not dwarf_formref.
732
7332007-10-16 Roland McGrath <roland@redhat.com>
734
735 * readelf.c (hex_dump): Fix rounding error in whitespace calculation.
736
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00007372007-10-15 Roland McGrath <roland@redhat.com>
738
739 * make-debug-archive.in: New file.
740 * Makefile.am (EXTRA_DIST): Add it.
741 (make-debug-archive): New target.
742 (bin_SCRIPTS, CLEANFILES): Add it.
743
7442007-10-10 Roland McGrath <roland@redhat.com>
745
746 * elflint.c (special_sections): Add new attrflag value exact_or_gnuld.
747 Use it to check MERGE|STRINGS for .debug_str.
748 (check_sections): Handle exact_or_gnuld.
749
7502007-10-08 Roland McGrath <roland@redhat.com>
751
752 * readelf.c (handle_core_item): Handle 'T'|0x80 to indicate
753 64-bit struct timeval with 32-bit tv_usec.
754
7552007-10-07 Roland McGrath <roland@redhat.com>
756
757 * readelf.c (check_archive_index): New function.
758 (process_file): Call it. Change signature to take only fd and name.
759 Use libdwfl to open the file, then iterate on its modules (multiple
760 for an archive) to print file name and call process_elf_file.
761 (main): Update caller. Let process_file do elf_begin.
762 (count_dwflmod, process_dwflmod, find_no_debuginfo): New functions.
763 (process_elf_file): Take only Dwfl_Module * argument.
764 Don't print the file name here.
765 (print_debug_*_section): Take Dwfl_Module * argument.
766 (print_debug): Likewise. Update caller.
767 (format_dwarf_addr): New function.
768 (print_debug_ranges_section): Use it.
769 (attr_callback): Likewise.
770 (print_debug_line_section, print_debug_loc_section): Likewise.
771
772 * readelf.c (print_debug_ranges_section): Translate all strings.
773 (print_debug_loc_section): Likewise.
774
775 * unstrip.c (copy_elided_sections): Initialize SEC.
776
777 * ar.c (do_oper_insert): Put trailing / on short names.
778
779 * arlib.h (MAX_AR_NAME_LEN): Decrease by one.
780
781 * arlib2.c (arlib_add_long_name): Adjust for header size.
782
783 * arlib.c (arlib_finalize): Pad long name table to keep size even.
784
785 * ar.c (do_oper_insert): Use write_retry for padding write.
786
787 * ar.c (do_oper_insert): Initialize CUR_OFF in no_old case.
788 Unconditionally set FOUND[CNT]->elf when setting ->mem.
789 (remember_long_name): New function.
790 (do_oper_insert): Call it. Correctly use length of basename,
791 not original name. Don't store long name twice for new member.
792
7932007-10-06 Roland McGrath <roland@redhat.com>
794
795 * elflint.c (check_note): Skip empty segment.
796 (check_note_section): Skip empty section.
797
798 * unstrip.c (options, parse_opt, struct arg_info): Grok -R/--relocate.
799 (handle_output_dir_module, handle_implicit_modules): Pass it down.
800 (handle_dwfl_module): When set, use ET_REL already loaded by Dwfl.
801 (compare_alloc_sections): Take new arg REL, ignore address if true.
802 (compare_sections): Likewise, pass it down.
803 (compare_sections_rel, compare_sections_nonrel): New functions.
804 (find_alloc_sections_prelink, copy_elided_sections): Use them
805 instead of compare_sections.
806 (sections_match): New function, broken out of ...
807 (find_alloc_section): ... here.
808 (copy_elided_sections): Reorganize section match-up logic.
809 Use sections_match for SHF_ALLOC in ET_REL.
810 For ET_REL, let the nonzero sh_addr from the debug file dominate.
811
812 * unstrip.c (add_new_section_symbols): Take new arg REL.
813 When true, do not update section symbol values.
814 (collect_symbols): Likewise. Update section symbols with address
815 of chosen output section, not original section.
816 (check_symtab_section_symbols, copy_elided_sections): Update callers.
817
818 * unstrip.c (compare_alloc_sections): At the same address, preserve
819 original section order.
820
821 * elflint.c (special_sections): Don't require MERGE|STRINGS for
822 .debug_str, it didn't always have them with older tools.
823
824 * elflint.c (check_symtab, check_one_reloc): Ignore sh_addr in ET_REL.
825
8262007-10-05 Roland McGrath <roland@redhat.com>
827
828 * elflint.c (check_symtab): Allow SHN_UNDEF _GLOBAL_OFFSET_TABLE_ in
829 ET_REL file.
830
831 * elflint.c (check_symtab): For _GLOBAL_OFFSET_TABLE_, diagnose
832 SHN_UNDEF as "bad section". Use shndx value in messages.
833
834 * elflint.c (special_sections): Add ".debug_str". Decrement namelen
835 for ".debug" so it matches as a prefix.
836 (IS_KNOWN_SPECIAL): New macro.
837 (check_sections): Use it for ".plt" match. Cite wrong SHT_NOBITS
838 type even under -d, for a .debug* or .shstrtab section.
839
840 * readelf.c (print_ops): Use hex for address operand.
841
8422007-10-04 Roland McGrath <roland@redhat.com>
843
844 * unstrip.c (copy_elided_sections): Initialize NDX_SECTION element for
845 .gnu_debuglink section to SHN_UNDEF. Drop STT_SECTION symbols for
846 sections mapped to SHN_UNDEF.
847
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00008482007-10-04 Ulrich Drepper <drepper@redhat.com>
849
850 * readelf.c (dump_archive_index): Avoid warning about uninitialized
851 variable with older glibc versions.
852 Add some branch prediction.
853
Roland McGrath59ea7f32007-10-04 08:50:09 +00008542007-10-04 Roland McGrath <roland@redhat.com>
855
856 * readelf.c (print_archive_index): New variable.
857 (options, parse_opt): Accept -c/--archive-index to set it.
858 (dump_archive_index): New function.
859 (process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
860 Call dump_archive_index on archives if set.
861 (main): Update caller.
862 (any_control_option): Give it file scope, moved out of ...
863 (parse_opt): ... here.
864
8652007-10-03 Roland McGrath <roland@redhat.com>
866
867 * unstrip.c (struct arg_info): Add `list' flag.
868 (options, parse_opt): Grok -n/--list to set it.
869 (list_module): New function.
870 (handle_implicit_modules): Call it under -n.
871
872 * elflint.c (check_note_section): New function.
873 (check_sections): Call it for SHT_NOTE.
874
875 * readelf.c (handle_notes): Use sections when available.
876
877 * elflint.c (check_note_data): New function, broken out of ...
878 (check_note): ... here. Call it and elf_getdata_rawchunk.
879
880 * readelf.c (handle_auxv_note): Take offset as argument, not buffer.
881 Use elf_getdata_rawchunk and gelf_getauxv.
882 (handle_notes_data): New function, broken out of ...
883 (handle_notes): ... here. Call it and elf_getdata_rawchunk.
884
Roland McGrath241ac022007-10-01 18:21:46 +00008852007-10-01 Roland McGrath <roland@redhat.com>
886
Roland McGrathac0a16c2007-10-01 18:50:35 +0000887 * readelf.c (hex_dump): Fix transposed subtraction generating spaces.
888
Roland McGrath241ac022007-10-01 18:21:46 +0000889 * readelf.c (hex_dump): Fix line header to be hex instead of decimal.
890
Roland McGrathc76f0b02007-09-27 07:31:33 +00008912007-09-10 Roland McGrath <roland@redhat.com>
892
893 * readelf.c (options): Give -p optional argument, alias --string-dump.
894 (string_sections, string_sections_tail): New static variables.
895 (parse_opt): Set them when -p has an argument.
896 (print_string_section): New function, broken out of ...
897 (print_strings): ... here. Call it.
898 (dump_data_section): New function, broken out of ...
899 (dump_data): ... here. Call it.
900 (for_each_section_argument): New function, broken out of ...
901 (dump_data): ... here. Call it.
902 (dump_strings): New function.
903
9042007-08-31 Roland McGrath <roland@redhat.com>
905
906 * readelf.c (print_strings): Typo fix.
907
Roland McGrathcb6d8652007-08-23 08:10:54 +00009082007-08-23 Roland McGrath <roland@redhat.com>
909
910 * readelf.c (printf_with_wrap): Function removed.
911 (REGISTER_WRAP_COLUMN): New macro.
912 (handle_core_register): Use print_core_item instead.
913 (struct register_info): New type.
914 (compare_registers, compare_register_sets): New functions.
915 (register_bitpos, compare_sets_by_info): New functions.
916 (handle_core_registers): Use those to segregate and sort registers
917 for display.
918
919 * readelf.c (ITEM_WRAP_COLUMN): New macro.
920 (print_core_item): New function.
921 (handle_core_item): Use it instead of printf_with_wrap.
922 (compare_core_items, compare_core_item_groups): New functions.
923 (handle_core_items): Use them. Sort by group and force line breaks
924 between groups.
925
926 * readelf.c (handle_core_registers, handle_core_items): New functions,
927 broken out of ...
928 (handle_core_note): ... here. Call them.
929
9302007-08-22 Roland McGrath <roland@redhat.com>
931
932 * unstrip.c (new_shstrtab): New function, broken out of ...
933 (copy_elided_sections): ... here.
934
9352007-08-20 Roland McGrath <roland@redhat.com>
936
937 Avoid local function trampolines in nm binary.
938 * nm.c (sort_by_address): Move to a static function instead of local
939 inside show_symbols.
940 (sort_by_name_strtab): New static variable.
941 (sort_by_name): Use it. Move to a static function instead of local
942 inside show_symbols.
943 (show_symbols): Set sort_by_name_strtab.
944
9452007-08-19 Roland McGrath <roland@redhat.com>
946
947 * readelf.c (handle_auxv_note): New function.
948 (handle_notes): Call it.
949
950 * readelf.c (printf_with_wrap, convert): New functions.
951 (handle_core_item, (handle_core_register): New functions.
952 (handle_notes): Call those with details from ebl_core_note.
953
Roland McGrath099dd522007-08-13 22:58:36 +00009542007-08-12 Roland McGrath <roland@redhat.com>
955
956 * elflint.c (check_note): Accept type 0 with name "Linux".
957
958 * elflint.c (special_sections): Accept SHF_ALLOC for ".note".
959
960 * elflint.c (section_flags_string): Return "none" for 0, not "".
961
Roland McGrathd8221722007-08-11 21:18:09 +00009622007-08-11 Roland McGrath <roland@redhat.com>
963
964 * elflint.c (check_note): Accept NT_GNU_HWCAP, NT_GNU_BUILD_ID.
965
Ulrich Drepperc98bcc72007-08-04 17:06:14 +00009662007-08-04 Ulrich Drepper <drepper@redhat.com>
967
968 * readelf.c (hex_dump): Use isprint to determine whether to print
969 character itself or full stop character.
970 (dump_data): No need to check endp for NULL after strtol call.
971
Roland McGrath60fc84c2007-08-03 21:59:15 +00009722007-08-03 Roland McGrath <roland@redhat.com>
973
974 * readelf.c (print_string_sections): New variable.
975 (options, parse_opt): Handle --strings/-p to set it.
976 (print_strings): New function.
977 (process_elf_file): Call it under -p.
978
979 * readelf.c (options): Add hidden aliases --segments, --sections,
980 as taken by binutils readelf.
981
9822007-08-01 Roland McGrath <roland@redhat.com>
983
984 * readelf.c (dump_data_sections, dump_data_sections_tail):
985 New variables.
986 (options, parse_opt): Handle --hex-dump/-x, set them.
987 (hex_dump): New function.
988 (dump_data): New function, call it.
989 (process_elf_file): Call it.
990
9912007-07-25 Roland McGrath <roland@redhat.com>
992
993 * addr2line.c (show_symbols): New variable.
994 (print_addrsym): New function.
995 (handle_address): Call it.
996 (options, parse_opt): Handle -S/--symbols.
997
Ulrich Drepperb0243862007-06-06 00:09:36 +00009982007-06-05 Ulrich Drepper <drepper@redhat.com>
999
1000 * addr2line.c: Update for latest autoconf header.
1001 * ar.c: Likewise.
1002 * elfcmp.c: Likewise.
1003 * elflint.c: Likewise.
1004 * findtextrel.c: Likewise.
1005 * ld.c: Likewise.
1006 * ldgeneric.c: Likewise.
1007 * nm.c: Likewise.
1008 * objdump.c: Likewise.
1009 * ranlib.c: Likewise.
1010 * readelf.c: Likewise.
1011 * size.c: Likewise.
1012 * strings.c: Likewise.
1013 * strip.c: Likewise.
1014 * unstrip.c: Likewise.
1015
Roland McGrath9aa8ef72007-05-18 08:59:43 +000010162007-05-18 Roland McGrath <roland@redhat.com>
1017
1018 * unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
1019 stripped file, so as not to duplicate a section copied in both.
1020
1021 * strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
1022
10232007-05-17 Roland McGrath <roland@redhat.com>
1024
1025 * unstrip.c (copy_elided_sections): Don't call gelf_newphdr for 0.
1026
1027 * unstrip.c (handle_file): Tweak BIAS != 0 warning.
1028
1029 * unstrip.c (handle_file): Take new arg CREATE_DIRS. If set,
1030 call make_directories here.
1031 (handle_explicit_files): Take new arg CREATE_DIRS, pass it down.
1032 (handle_dwfl_module): Likewise.
1033 (handle_implicit_modules): Update callers.
1034 (handle_output_dir_module): Likewise. Don't do make_directories here.
1035
1036 * unstrip.c (get_section_name): New function, broken out of ...
1037 (copy_elided_sections): here. Update callers.
1038 (find_alloc_section): Broken out of ...
1039 (copy_elided_sections): ... here. Update caller.
1040 (symtab_count_leading_section_symbols): Take new arg NEWSYMDATA,
1041 update STT_SECTION symbols' st_value fields as a side effect.
1042 (check_symtab_section_symbols): Update caller.
1043 (add_new_section_symbols): Set st_value in symbols added.
1044 (collect_symbols): Reset S->value for STT_SECTION symbols recorded.
1045 Take new arg SPLIT_BSS. Adjust S->shndx recorded for symbols moved
1046 from .bss to .dynbss.
1047 (find_alloc_sections_prelink): New function. Associate debug file
1048 allocated SHT_NOBITS shdrs with stripped moved by prelink via
1049 .gnu.prelink_undo information.
1050 (copy_elided_sections): Call it when we couldn't find every allocated
1051 section. Don't use a debug file non-NOBITS section if SHF_ALLOC.
1052 Take STRIPPED_EHDR arg instead of E_TYPE and PHNUM.
1053 (handle_file): Update callers.
1054
1055 * unstrip.c (copy_elided_sections): Ignore unfound unallocated section
1056 named ".comment".
1057
1058 * elflint.c (check_sections): Fix association of segments with
1059 sections when p_memsz > p_filesz.
1060
10612007-04-29 Roland McGrath <roland@redhat.com>
1062
1063 * addr2line.c (options, main): Tweak argp group settings to fix
1064 usage output.
1065
10662007-04-28 Roland McGrath <roland@redhat.com>
1067
1068 * strip.c (handle_elf): Update debug file's SHT_NOBITS sections'
1069 sizes to match sections adjusted in the stripped file.
1070
Roland McGrath4be15242007-04-25 03:09:33 +000010712007-04-24 Roland McGrath <roland@redhat.com>
1072
1073 * elfcmp.c (OPT_HASH_INEXACT): New macro.
1074 (hash_inexact): New variable.
1075 (options, parse_opt): Add --hash-inexact option to set it.
1076 (hash_content_equivalent): New function.
1077 (main): Call it for differing SHT_HASH sections under --hash-inexact.
1078
10792007-04-23 Roland McGrath <roland@redhat.com>
1080
1081 * unstrip.c: New file.
1082 * Makefile.am (bin_PROGRAMS): Add it.
1083 (unstrip_LDADD): New variable.
1084
1085 * strip.c (options): Allow --output for -o.
1086
Ulrich Drepper8b383102007-02-16 00:31:57 +000010872007-02-15 Ulrich Drepper <drepper@redhat.com>
1088
1089 * readelf.c: Remove unused code. Add a few consts.
1090
Ulrich Drepper903c1162007-02-15 19:40:37 +000010912007-02-15 Roland McGrath <roland@redhat.com>
1092
1093 * readelf.c (print_debug): Fix brainos in SHDR test.
1094
Roland McGrathf82a1ec2007-02-06 04:47:44 +000010952007-02-05 Roland McGrath <roland@redhat.com>
1096
1097 * ar.c: Include <limits.h>, since we use LONG_MAX.
1098
Ulrich Drepper0fe63532007-02-05 21:05:51 +000010992007-02-05 Ulrich Drepper <drepper@redhat.com>
1100
Ulrich Drepper8b383102007-02-16 00:31:57 +00001101 * ar.c: Add ugly hack to work around gcc complaining that we
Ulrich Drepper93ab56f2007-02-05 22:12:41 +00001102 ignore fchown's return value.
1103 (do_oper_insert): Handle error when writing padding.
1104 * ranlib.c: Add fchown complain work around.
1105
Ulrich Drepper0fe63532007-02-05 21:05:51 +00001106 * arlib.c: Make symtab a global variable. Change all users.
1107 * arlib2.c: Likewise.
1108 * ranlib.c: Likewise.
1109 * ar.c: Likewise.
1110 * arlib.h: Declare it.
1111
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000011122007-01-11 Roland McGrath <roland@redhat.com>
1113
1114 * elflint.c (check_sections): Use ebl_machine_section_flag_check on
1115 SHF_MASKPROC bits separately from generic sh_flags validation.
1116
Ulrich Drepperce0bdb62007-02-05 07:13:52 +000011172007-02-04 Ulrich Drepper <drepper@redhat.com>
1118
1119 * ar.c: New file.
1120 * arlib.c: New file.
1121 * arlib2.c: New file.
1122 * arlib.h: New file.
1123 * Makefile (noinst_LIBRARIES): Add libar.
1124 (libar_a_SOURCES): Define.
1125 (ar_LDADD): Define.
1126 (CFLAGS_ar): Define.
1127 * ranlib.c: Change to use arlib.
1128
1129 * elflint.c (check_symtab): Work around GNU ld bug which omits
1130 sections but not symbols in those sections.
1131
Ulrich Drepperb770cf92007-01-10 21:02:34 +000011322007-01-10 Ulrich Drepper <drepper@redhat.com>
1133
1134 * addr2line.c: Update copyright year.
1135 * elfcmp.c: Likewise.
1136 * elflint.c: Likewise.
1137 * findtextrel.c: Likewise.
1138 * ld.c: Likewise.
1139 * nm.c: Likewise.
1140 * objdump.c: Likewise.
1141 * ranlib.c: Likewise.
1142 * readelf.c: Likewise.
1143 * size.c: Likewise.
1144 * strings.c: Likewise.
1145 * strip.c: Likewise.
1146
Ulrich Drepper7c0e79f2006-12-09 21:10:19 +000011472006-12-09 Ulrich Drepper <drepper@redhat.com>
1148
1149 * elflint.c (compare_hash_gnu_hash): New function. Report if the
1150 two hash tables have different content (module expected omission
1151 of undefined symbols).
1152
Roland McGrath8190db62006-12-17 23:56:51 +000011532006-10-31 Roland McGrath <roland@redhat.com>
1154
1155 * elflint.c (check_program_header): Don't complain about
Ulrich Drepper56bc0b82006-12-18 22:38:08 +00001156 p_filesz > p_memsz if p_memsz is zero and p_type is PT_NOTE.
Roland McGrath8190db62006-12-17 23:56:51 +00001157
11582006-09-19 Jakub Jelinek <jakub@redhat.com>
1159
1160 * strip.c (process_file): Disallow -f on archives.
1161
11622006-10-09 Roland McGrath <roland@redhat.com>
1163
1164 * Makefile.am (libld_elf_i386.so): Use $(LINK), not $(CC).
1165
Roland McGrathc373d852006-10-10 00:25:21 +000011662006-08-29 Roland McGrath <roland@redhat.com>
1167
1168 * Makefile.am (MAINTAINERCLEANFILES): New variable.
1169
1170 * readelf.c (handle_relocs_rel): Typo fix, test DESTSHDR properly.
1171 Reported by Christian Aichinger <Greek0@gmx.net>.
1172
1173 * elflint.c (valid_e_machine): Add EM_ALPHA.
1174 Reported by Christian Aichinger <Greek0@gmx.net>.
1175
Ulrich Drepper231c5902006-08-08 22:00:11 +000011762006-08-08 Ulrich Drepper <drepper@redhat.com>
1177
1178 * elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
1179 Keep track of which "high DT" entries are present.
1180 Check that either old or GNU-style hash table is present.
1181 If GNU-style hash table is used a symbol table is mandatory.
1182 Check that if any prelink entry is present all of them are.
1183 (check_gnu_hash): Only fail for undefined symbols in GNU-style hash
1184 table if they don't refer to functions.
1185
Roland McGrath858b1892006-07-17 08:41:15 +000011862006-07-17 Roland McGrath <roland@redhat.com>
1187
1188 * elflint.c (struct version_namelist): Use GElf_Versym for `ndx' field.
1189 (add_version): Likewise for argument.
1190 (check_versym): Cast constant to GElf_Versym for comparison.
1191
Roland McGrath4ec807e2006-07-13 03:59:46 +000011922006-07-12 Roland McGrath <roland@redhat.com>
1193
1194 * readelf.c (handle_gnu_hash): Add casts for machines where
1195 Elf32_Word != unsigned int.
1196
Ulrich Drepperdcf61602006-07-12 19:59:02 +000011972006-07-12 Ulrich Drepper <drepper@redhat.com>
1198
1199 * elflint.c (check_sysv_hash64): Fix printf format.
1200
Ulrich Dreppercc415622006-07-12 19:42:23 +000012012006-07-11 Roland McGrath <roland@redhat.com>
Ulrich Drepper8ae58142006-07-12 05:22:32 +00001202
Ulrich Dreppercc415622006-07-12 19:42:23 +00001203 * addr2line.c (options): English fix in -f doc string.
1204
1205 * addr2line.c (use_comp_dir): New variable.
1206 (options, parse_opt): Grok -A/--absolute to set it.
1207 (handle_address): If set, prepend dwfl_line_comp_dir results to
1208 relative file names.
Ulrich Drepper8ae58142006-07-12 05:22:32 +00001209
Ulrich Drepper28ed8952006-07-07 03:43:47 +000012102006-07-06 Ulrich Drepper <drepper@redhat.com>
1211
1212 * elflint.c: Adjust for latest new hash table format.
1213 * readelf.c: Likewise.
1214
1215 * elflint.c (check_versym): Ignore hidden bit when comparing version
1216 numbers.
1217
12182006-07-05 Ulrich Drepper <drepper@redhat.com>
1219
1220 * ldgeneric.c (ld_generic_create_outfile): Correctly recognize
1221 discarded COMDAT symbols.
1222
1223 * i386_ld.c (elf_i386_count_relocations): Lot of corrections.
1224 (elf_i386_create_relocations): Likewise.
1225 * ld.h (struct symbol): Add local and hidden bits.
1226 * ld.c (create_special_section_symbol): These synthsized symbols
1227 are local and hidden.
1228 * ldgeneric.c (file_process2): Check whether input file matches
1229 the emulation.
1230 (fillin_special_symbol): Create symbols as local and/or hidden
1231 if requested.
1232 (ld_generic_create_outfile): Make local copy of symbol.
1233 Don't hide global, defined symbols in dynamic symbol table unless
1234 requested. Synthetic symbols have no version information.
1235
1236 * elflint.c: Add support for checking 64-bit SysV-style hash tables.
1237 * readelf.c: Add support for printing 64-bit SysV-style hash tables.
1238
12392006-07-04 Ulrich Drepper <drepper@redhat.com>
1240
1241 * elflint.c (is_rel_dyn): Fix and extend DT_RELCOUNT/DT_RELACOUNT
1242 testing.
1243
12442006-07-03 Ulrich Drepper <drepper@redhat.com>
1245
1246 * elflint.c: Add testing of DT_GNU_HASH.
1247 * readelf.c: Implement showing histogram for DT_GNU_HASH section.
1248
1249 * Makefile.am: Add hacks to create dependency files for non-generic
1250 linker.
1251
Ulrich Drepper6ca46002006-06-12 22:40:23 +000012522006-06-12 Ulrich Drepper <drepper@redhat.com>
1253
1254 * ldgeneric.c (ld_generic_generate_sections): Don't create .interp
1255 section if creating a DSO and no interpreter is given.
1256 (ld_generic_create_outfile): Don't store reference to symbols in
1257 discarded COMDAT groups. Don't create PHDR and INTERP program header
1258 for DSO if no interpreter is specified.
Ulrich Drepper595d0e72006-06-12 23:25:17 +00001259 (create_verneed_data): Pretty printing.
1260
Ulrich Drepper6ca46002006-06-12 22:40:23 +00001261 * ldscript.y (content): If a DSO is created don't set default
1262 interpreter from linker script.
1263
1264 * i386_ld.c (elf_i386_count_relocations): Do not add relocations
1265 for symbols in discarded COMDAT groups.
1266 (elf_i386_create_relocations): Likewise.
1267 * ld.h (struct scninfo): Add unused_comdat.
1268 * ldgeneric.c (add_section): Also check group signature when
1269 matching COMDAT sections.
1270 (add_relocatable_file): Ignore symbols in COMDAT group which are
1271 discarded.
1272
1273 * elflint.c (check_one_reloc): For *_NONE relocs only check type
1274 and symbol reference.
1275
Ulrich Drepper54f33a72006-06-11 09:07:37 +000012762006-06-11 Ulrich Drepper <drepper@redhat.com>
1277
Ulrich Dreppercbb51e52006-06-11 20:25:23 +00001278 * elflint.c (check_dynamic): Fix checking value of tags which are
1279 offsets in the string section. Make sure DT_STRTAB points to the
1280 section referenced in sh_link.
1281
1282 * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
1283
Ulrich Drepper54f33a72006-06-11 09:07:37 +00001284 * ld.c: Recognize --eh-frame-hdr option.
1285 * ld.h (struct ld_state): Add eh_frame_hdr field.
1286 * ldgeneric.c (struct unw_eh_frame_hdr): Define.
1287
1288 * ldgeneric.c (add_section): Use ebl_sh_flags_combine instead of
1289 SH_FLAGS_COMBINE.
1290 (add_relocatable_file): Minor optimization of last change.
1291 (match_section): Don't preserve SHF_GROUP flag any longer.
1292
Ulrich Drepper2d880282006-06-11 00:20:43 +000012932006-06-10 Ulrich Drepper <drepper@redhat.com>
1294
1295 * ld.c (parse_z_option): Recognize execstack and noexecstack.
Ulrich Drepper4f0a7a82006-06-11 00:53:45 +00001296 Handle record and ignore as position dependent options.
1297 (parse_z_option_2): Handle ignore and record here.
Ulrich Drepper2d880282006-06-11 00:20:43 +00001298 * ld.h (struct ld_state): Add execstack field.
1299 * ldgeneric.c (add_relocatable_file): Recognize .note.GNU-stack
1300 sections.
1301 (ld_generic_create_outfile): Fix program header creation in native
1302 linker. Add PT_GNU_STACK program header.
1303
Ulrich Dreppera688a732006-06-10 06:33:00 +000013042006-06-09 Ulrich Drepper <drepper@redhat.com>
1305
1306 * i386_ld.c (elf_i386_finalize_plt): Don't change symbol table entries
1307 for PLT entries if there is no local definition.
1308
1309 * ld.c (parse_option): Handle -z ignore like --as-needed and
1310 -z record like --no-as-needed.
1311 * ld.h (struct ld_state): Remove ignore_unused_dsos field.
1312 * ldgeneric.c (new_generated_scn): Always compute ndt_needed by
1313 looping over DSOs. When deciding about adding DT_NEEDED entries
1314 use ->as_needed instead of ignore_unused_dsos.
1315
Ulrich Drepper8c56fe32006-05-31 15:50:43 +000013162006-05-31 Ulrich Drepper <drepper@redhat.com>
Ulrich Drepper11b030e2006-05-28 20:28:19 +00001317
Ulrich Drepper8c56fe32006-05-31 15:50:43 +00001318 * ld.c: Recognize --as-needed and --no-as-needed options.
1319 * ld.h (struct usedfile): Add as_needed field.
1320 (struct ld_state): Likewise.
1321 * ldgeneric.c (ld_handle_filename_list): Copy as_needed flag from
1322 the list.
1323 * ldscript.y (filename_id_list): Split to correctly parse all
1324 combinations.
1325 (mark_as_needed): Fix loop.
Ulrich Drepper11b030e2006-05-28 20:28:19 +00001326
Ulrich Drepper697f4db2006-06-10 06:50:47 +000013272006-05-28 Ulrich Drepper <drepper@redhat.com>
1328
1329 * addr2line.c (print_dwarf_function): Use unsigned type for lineno
1330 and colno.
1331
Ulrich Drepper2cb8e732006-05-27 21:57:27 +000013322006-05-27 Ulrich Drepper <drepper@redhat.com>
1333
1334 * readelf.c (handle_relocs_rela): Better notations for addon value.
Ulrich Drepper41a99082006-05-28 00:01:43 +00001335 (print_ehdr): Distinguish e_ident[EI_VERSION] from e_version.
Ulrich Drepper2cb8e732006-05-27 21:57:27 +00001336
Ulrich Drepper82c345d2006-04-04 22:07:54 +000013372006-04-04 Ulrich Drepper <drepper@redhat.com>
1338
1339 * addr2line.c: Update copyright year.
1340 * elfcmp.c: Likewise.
1341 * elflint.c: Likewise.
1342 * findtextrel.c: Likewise.
1343 * ld.c: Likewise.
1344 * nm.c: Likewise.
1345 * objdump.c: Likewise.
1346 * ranlib.c: Likewise.
1347 * readelf.c: Likewise.
1348 * size.c: Likewise.
1349 * strings.c: Likewise.
1350 * strip.c: Likewise.
1351
Roland McGrathdd7e22b2006-03-09 23:05:47 +000013522006-03-09 Roland McGrath <roland@redhat.com>
1353
1354 * Makefile.am (AM_LDFLAGS): New variable.
1355
Roland McGrath060fa052006-03-02 07:51:50 +000013562006-03-01 Roland McGrath <roland@redhat.com>
1357
1358 * readelf.c (dwarf_tag_string, dwarf_attr_string): Update name tables
1359 for dwarf.h changes matching 3.0 spec.
1360 (dwarf_encoding_string, dwarf_lang_string, print_ops): Likewise.
1361
Ulrich Drepper038129b2005-12-04 16:47:24 +000013622005-12-04 Ulrich Drepper <drepper@redhat.com>
1363
1364 * elflint.c (check_one_reloc): If relocation section is not loaded,
1365 don't check whether the relocations modify read-only sections or
1366 loaded and unloaded sections.
1367
Ulrich Drepper607e0542005-12-04 15:51:06 +000013682005-11-28 Ulrich Drepper <drepper@redhat.com>
1369
1370 * elflint.c (check_one_reloc): Take additional parameters. Use
1371 them to determine whether relocation is valid in this type of
1372 file. DSOs and executables can contain relocation sections in
1373 unloaded sections which just show the relocations the linker
1374 applied. Adjust all callers.
1375 (check_program_header): Check that PT_PHDR is loaded and that offset
1376 matches the one in the ELF header.
1377
Roland McGrath6724c902005-10-28 07:07:19 +000013782005-10-26 Roland McGrath <roland@redhat.com>
1379
1380 * nm.c (get_var_range): dwarf_getloclist -> dwarf_getlocation.
1381
Ulrich Drepperd0449522005-09-03 07:23:52 +000013822005-09-03 Ulrich Drepper <drepper@redhat.com>
1383
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +00001384 * strip.c (handle_elf): Unify some error messages.
1385 * ld.c (main): Likewise.
1386 * ldgeneric.c (open_elf): Likewise.
1387 * elfcmp.c (main): Likewise.
1388 * elflint.c (check_elf_header): Likewise.
1389
1390 * size.c (process_file): Fix typo in error message.
1391
Ulrich Drepperd0449522005-09-03 07:23:52 +00001392 * readelf.c: Lots of little cleanups. Use _unlocked functions.
1393
Ulrich Dreppera60501e2005-09-02 19:50:17 +000013942005-09-02 Ulrich Drepper <drepper@redhat.com>
1395
Ulrich Dreppere3f9b7d2005-09-03 16:42:46 +00001396 * strings.c (main): Reset elfmap variable after munmap call.
Ulrich Drepper618795f2005-09-02 20:01:37 +00001397 [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
Ulrich Dreppera60501e2005-09-02 19:50:17 +00001398
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000013992005-08-28 Ulrich Drepper <drepper@redhat.com>
1400
1401 * ranlib.c: Don't define pread_retry and write_retry here.
1402
1403 * Makefile.an [BUILD_STATIC] (libdw): Add -ldl.
1404 (CLEANFILES): Add *.gcno *.gcda *.gconv.
1405
1406 * strings.c (process_chunk): Reorder expressions in conditional
1407 (process_chunk_mb): Likewise.
1408
1409 * strings.c: New file.
1410 * Makefile.am (bin_PROGRAMS): Add strings.
1411 (strings_no_Wstring): Define.
1412 (strings_LDADD): Define.
1413
Roland McGrath71e15a02005-08-27 10:33:26 +000014142005-08-27 Roland McGrath <roland@redhat.com>
1415
1416 * addr2line.c (dwarf_diename_integrate): Function removed.
1417 (print_dwarf_function): Use plain dwarf_diename.
1418
Ulrich Drepperc5a06cd2005-08-24 19:50:14 +000014192005-08-24 Ulrich Drepper <drepper@redhat.com>
1420
1421 * elflint.c (check_versym): Versioned symbols should not have
1422 local binding.
1423
Ulrich Drepper5d832292005-08-15 21:36:27 +000014242005-08-15 Ulrich Drepper <drepper@redhat.com>
1425
Ulrich Drepper61655e02005-08-16 04:23:02 +00001426 * elflint.c (check_versym): Allow VER_NDX_LOCAL symbols to be
1427 undefined.
1428
Ulrich Drepper5d832292005-08-15 21:36:27 +00001429 * Makefile.am: Add rules to build ranlib.
1430 * ranlib.c: New file.
1431
Roland McGrath18e13422005-08-15 08:01:25 +000014322005-08-14 Roland McGrath <roland@redhat.com>
1433
1434 * elflint.c (check_sections): Use ebl_section_type_name and allow any
1435 sh_type it recognizes.
1436
1437 * elflint.c (check_sections): Print unknown flags in hex, don't
1438 truncate high bits. Print section number and name for unknown type.
1439
Roland McGrathf6895042005-08-13 20:56:52 +000014402005-08-13 Roland McGrath <roland@redhat.com>
1441
1442 * elflint.c (check_program_header): Use ebl_segment_type_name and
1443 allow any p_type it recognizes. Include p_type value in error
1444 message for unknown type.
1445
Ulrich Drepperc5c33a62005-08-13 17:50:47 +000014462005-08-13 Ulrich Drepper <drepper@redhat.com>
1447
1448 * elflint.c (check_symtab): Simplify last change a bit. Pass ehdr
1449 to ebl_check_special_symbol.
1450 (check_sections): Pass ehdr to ebl_bss_plt_p.
1451
Roland McGrath653d3762005-08-13 01:59:10 +000014522005-08-12 Roland McGrath <roland@redhat.com>
1453
1454 * elflint.c (check_symtab): Check that _GLOBAL_OFFSET_TABLE_ st_shndx
1455 refers to the right section if it's not SHN_ABS.
1456 Let ebl_check_special_symbol override _G_O_T_ value and size checks.
1457
1458 * elflint.c (check_sections): Don't complain about a non-NOBITS
1459 section taking no segment space, if it's sh_size is 0.
1460
1461 * elflint.c (check_sections): Use ebl_bss_plt_p to see if .plt should
1462 be PROGBITS or NOBITS.
1463
1464 * elflint.c (check_symtab): Use ebl_check_special_symbol to override
1465 standard st_value and st_size checks.
1466
Roland McGrath1c83bf12005-08-11 07:03:55 +000014672005-07-28 Roland McGrath <roland@redhat.com>
Ulrich Drepperfaf4d192005-08-11 05:12:05 +00001468
Roland McGrath1c83bf12005-08-11 07:03:55 +00001469 * addr2line.c (options, parse_opt): Don't handle -e here.
1470 (executable): Variable removed.
1471 (argp_children): New static variable.
1472 (argp): Use it. Make const.
1473 (main): Fill in argp_children from dwfl_standard_argp ().
1474 Let libdwfl handle file selection, pass Dwfl handle to handle_address.
1475 (print_dwarf_function): New function. Try to figure out inline chain.
1476 (elf_getname): Function removed, libdwfl does it for us.
1477 (handle_address): Take Dwfl handle instead of Elf, Dwarf handles.
1478 Use dwfl_module_addrname instead of elf_getname.
1479 Use dwfl_module_getsrc and dwfl_lineinfo instead of libdw calls.
1480 * Makefile.am (INCLUDES): Add libdwfl directory to path.
1481
14822005-08-10 Ulrich Drepper <drepper@redhat.com>
1483
1484 * strip.c (parse_opt): STATE parameter is now used.
1485 Various little cleanups.
1486
1487 * readelf.c (print_debug_line_section): Correct fallout of renaming
1488 of DW_LNS_set_epilog_begin.
Ulrich Drepper6d5c3bd2005-08-11 04:37:52 +00001489
Roland McGrath8f31c2c2005-08-09 04:58:05 +000014902005-08-08 Roland McGrath <roland@redhat.com>
1491
1492 * strip.c (options, parse_opt): Grok -R .comment for compatibility
1493 with binutils strip. Likewise -d, -S, as aliases for -g.
1494 Likewise ignore -s/--strip-all.
1495
Roland McGrath095a01b2005-08-08 03:49:35 +000014962005-08-07 Roland McGrath <roland@redhat.com>
1497
1498 * strip.c (process_file): Open read-only when using a different output
1499 file.
1500
Ulrich Drepper47be7952005-08-07 04:41:39 +000015012005-08-06 Ulrich Drepper <drepper@redhat.com>
1502
Ulrich Drepper637963b2005-08-07 05:33:07 +00001503 * elflint.c (in_nobits_scn): New function.
1504 (check_versym): Allow references for defined symbols against versions
1505 of other DSOs also for symbols in nobits sections.
1506 Move a few variables around.
1507
Ulrich Drepper47be7952005-08-07 04:41:39 +00001508 * Makefile.am (AM_CFLAGS): Avoid duplication.
1509 Link with statis libs if BUILD_STATIC.
1510
Ulrich Drepperdbace232005-08-06 01:37:23 +000015112005-08-05 Ulrich Drepper <drepper@redhat.com>
1512
1513 * elflint.c: Many, many more tests. Mostly related to symbol
1514 versioning. Those sections should now be completely checked.
1515
1516 * readelf.c (print_dynamic): Use gelf_offscn.
1517
Ulrich Drepperacb89832005-08-04 07:01:49 +000015182005-08-04 Ulrich Drepper <drepper@redhat.com>
1519
1520 * elflint.c: Add lots more tests: more extension symbol table sanity,
1521 versioning section tests, hash table tests. General cleanup.
1522
Ulrich Drepperc911c9e2005-08-02 16:07:42 +000015232005-08-02 Ulrich Drepper <drepper@redhat.com>
1524
Ulrich Drepper8a687742005-08-03 02:24:12 +00001525 * objdump.c: New file.
1526 * Makefile.am (bin_PROGRAMS): Add objdump.
1527 (objdump_LDADD): Define.
1528
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001529 * elflint.c (check_reloc_shdr): New function split out from check_rela
1530 and check_rel.
1531 (check_one_reloc): New function. Likewise.
1532 (check_rela): Use check_reloc_shdr and check_one_reloc.
1533 (check_rel): Likewise.
Ulrich Drepper41de4882005-08-03 00:02:56 +00001534 (check_program_header): Check that PT_DYNAMIC entry matches .dynamic
1535 section.
1536 Add checks that relocations against read-only segments are flagged,
1537 that the text relocation flag is not set unnecessarily, and that
1538 relocations in one section are either against loaded or not-loaded
1539 segments.
Ulrich Drepperc911c9e2005-08-02 16:07:42 +00001540
Ulrich Drepper8533dcf2005-08-01 07:18:47 +000015412005-08-01 Ulrich Drepper <drepper@redhat.com>
1542
1543 * elfcmp.c (main): Ignore section count and section name string table
1544 section index.
1545
Roland McGrathf9ece8a2005-07-28 07:03:04 +000015462005-07-27 Roland McGrath <roland@redhat.com>
1547
1548 * elfcmp.c: Include <locale.h>.
1549
Ulrich Drepper7d48d6a2005-07-27 10:13:23 +000015502005-07-27 Ulrich Drepper <drepper@redhat.com>
1551
1552 * elfcmp.c: Print name and index of differing section.
1553
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000015542005-07-24 Ulrich Drepper <drepper@redhat.com>
1555
1556 * elfcmp.c: Implement comparing gaps between sections.
1557
15582005-07-23 Ulrich Drepper <drepper@redhat.com>
1559
1560 * elflint.c: Include libeblP.h instead of libebl.h.
1561 * nm.c: Likewise.
1562 * readelf.c: Likewise.
1563 * elfcmp.c: Likewise.
1564
1565 * elfcmp.c (main): Compare individual ELF header fields, excluding
1566 e_shoff instead of the whole struct at once.
1567 Use ebl_section_strip_p instead of SECTION_STRIP_P.
1568 * strip.c: Use ebl_section_strip_p instead of SECTION_STRIP_P.
1569
15702005-07-22 Ulrich Drepper <drepper@redhat.com>
1571
1572 * elfcmp.c (main): Take empty section into account when comparing
1573 section content.
1574
1575 * elflint.c (check_dynamic): Check that d_tag value is >= 0 before
1576 using it.
1577
15782005-07-21 Ulrich Drepper <drepper@redhat.com>
1579
1580 * elfcmp.c: New file.
1581 * Makefile.am (bin_PROGRAMS): Add elfcmp.
1582 (elfcmp_LDADD): Define.
1583
1584 * elflint.c (check_rela): Check that copy relocations only reference
1585 object symbols or symbols with unknown type.
1586 (check_rel): Likewise.
1587
15882005-06-08 Roland McGrath <roland@redhat.com>
1589
1590 * readelf.c (print_ops): Add consts.
1591
15922005-05-31 Roland McGrath <roland@redhat.com>
1593
1594 * readelf.c (print_debug_abbrev_section): Don't bail after first CU's
1595 abbreviations. Print a header line before each CU section.
1596
1597 * readelf.c (print_debug_loc_section): Fix indentation for larger
1598 address size.
1599
16002005-05-30 Roland McGrath <roland@redhat.com>
1601
1602 * readelf.c (print_debug_line_section): Print section offset of each
1603 CU's table, so they are easy to find from seeing the stmt_list value.
1604
1605 * readelf.c (dwarf_attr_string): Add all attributes in <dwarf.h>.
1606 (attr_callback): Grok DW_AT_ranges and print offset in hex.
1607
1608 * readelf.c (attr_callback): Add 2 to addrsize * 2 for %#0* format.
1609 (print_debug_ranges_section, print_debug_loc_section): Likewise.
1610
1611 * readelf.c (print_ops): Take different args for indentation control.
1612 (attr_callback): Caller updated.
1613 Grok several more block-form attributes as being location expressions.
1614 For those same attributes with udata forms, format output differently
1615 for location list offset.
1616 (print_debug_loc_section): Implement it for real.
1617
1618 * readelf.c (options): Mention ranges for --debug-dump.
1619 (enum section_e): Add section_ranges.
1620 (parse_opt): Grok "ranges" for -w/--debug-dump.
1621 (print_debug_ranges_section): New function.
1622 (print_debug): Handle .debug_ranges section.
1623
16242005-05-30 Ulrich Drepper <drepper@redhat.com>
1625
1626 * readelf.c (handle_notes): At least x86-64 need not have the note
1627 section values aligned to 8 bytes.
1628
16292005-05-18 Ulrich Drepper <drepper@redhat.com>
1630
1631 * readelf.c (dwarf_tag_string): Add new tags.
1632
16332005-05-08 Roland McGrath <roland@redhat.com>
1634
1635 * strip.c (handle_elf): Don't translate hash and versym data formats,
1636 elf_getdata already did it for us.
1637
16382005-05-07 Ulrich Drepper <drepper@redhat.com>
1639
1640 * Makefile.am (findtextrel_LDADD): Add $(libmudflap).
1641 (addr2line_LDADD): Likewise.
1642
16432005-05-03 Roland McGrath <roland@redhat.com>
1644
1645 * strip.c (handle_elf): Apply symbol table fixups to discarded
1646 relocation sections when they are being saved in the debug file.
1647
1648 * strip.c (handle_elf): Pass EHDR->e_ident[EI_DATA] to gelf_xlatetom
1649 and gelf_xlatetof, not the native byte order.
1650
1651 * strip.c (parse_opt): Give error if -f or -o is repeated.
1652 (main): Exit if argp_parse returns nonzero.
1653
1654 * strip.c (debug_fname_embed): New variable.
1655 (options, parse_opt): New option -F to set it.
1656
16572005-05-07 Ulrich Drepper <drepper@redhat.com>
1658
1659 * readelf.c (parse_opt): Make any_control_option variable
1660 local. Simplify some tests.
1661
16622005-05-03 Roland McGrath <roland@redhat.com>
1663
1664 * strip.c (crc32_file): Function removed (now in ../lib).
1665
16662005-05-03 Roland McGrath <roland@redhat.com>
1667
1668 * elflint.c (is_debuginfo): New variable.
1669 (options, parse_opt): New option --debuginfo/-d to set it.
1670 (check_sections): If is_debuginfo, don't complain about SHT_NOBITS.
1671 (check_note): If is_debuginfo, don't try to get note contents.
1672
16732005-04-24 Ulrich Drepper <drepper@redhat.com>
1674
1675 * readelf.c (print_debug_abbrev_section): Don't print error when end of
1676 section reached.
1677
16782005-04-14 Ulrich Drepper <drepper@redhat.com>
1679
1680 * readelf.c (dwarf_encoding_string): New function.
1681 (dwarf_inline_string): New function.
1682 (dwarf_access_string): New function.
1683 (dwarf_visibility_string): New function.
1684 (dwarf_virtuality_string): New function.
1685 (dwarf_identifier_case_string): New function.
1686 (dwarf_calling_convention_string): New function.
1687 (dwarf_ordering_string): New function.
1688 (dwarf_discr_list_string): New function.
1689 (attr_callback): Decode man more attribute values.
1690
16912005-04-01 Ulrich Drepper <drepper@redhat.com>
1692
1693 * addr2line.c: Finish implementation of -f option.
1694
16952005-03-29 Ulrich Drepper <drepper@redhat.com>
1696
1697 * addr2line.c: New file.
1698 * Makefile.am (bin_PROGRAMS): Add addr2line.
1699 Define addr2line_LDADD.
1700
1701 * findtextrel.c: Use new dwarf_addrdie function.
1702
1703 * findtextrel.c: Fix usage message and re-add accidentally removed
1704 line.
1705
17062005-03-28 Ulrich Drepper <drepper@redhat.com>
1707
1708 * findtextrel.c: New file.
1709 * Makefile: Add rules to build findtextrel.
1710
17112005-02-15 Ulrich Drepper <drepper@redhat.com>
1712
1713 * ldlex.l: Provide ECHO definition to avoid warning.
1714
1715 * elflint.c (check_program_header): Fix typo in RELRO test.
1716
1717 * Makefile.am (AM_CFLAGS): Add more warning options.
1718 * elflint.c: Fix warnings introduced by the new warning options.
1719 * i386_ld.c: Likewise.
1720 * ld.c: Likewise.
1721 * ld.h: Likewise.
1722 * ldgeneric.c: Likewise.
1723 * nm.c: Likewise.
1724 * readelf.c: Likewise.
1725 * sectionhash.c: Likewise.
1726 * size.c: Likewise.
1727 * string.c: Likewise.
1728
17292005-02-05 Ulrich Drepper <drepper@redhat.com>
1730
1731 * Makefile.am: Check for text relocations in constructed DSOs.
1732
1733 * Makefile.am [MUDFLAP] (AM_CFLAGS): Add -fmudflap. Link all apps
1734 with -lmudflap.
1735
1736 * ldscript.y: Add as_needed handling.
1737 * ldlex.l: Recognize AS_NEEDED token.
1738 * ld.h (struct filename_list): Add as_needed flag.
1739
17402005-02-04 Ulrich Drepper <drepper@redhat.com>
1741
1742 * elflint.c (check_symtab): Correctly determine size of GOT section.
1743
17442005-01-19 Ulrich Drepper <drepper@redhat.com>
1745
1746 * ld.c: Remove unnecessary more_help function. Print bug report
1747 address using argp.
1748 * strip.c: Likewise.
1749 * size.c: Likewise.
1750 * nm.c: Likewise.
1751 * readelf.c: Likewise.
1752 * elflint.c: Likewise.
1753
1754 * elflint.c (main): Don't check for parameter problems here.
1755 (parse_opt): Do it here, where we get informed about some of them
1756 anyway.
1757
1758 * readelf.c (main): Don't check for parameter problems here.
1759 (parse_opt): Do it here, where we get informed about some of them
1760 anyway.
1761
17622005-01-11 Ulrich Drepper <drepper@redhat.com>
1763
1764 * strip.c: Update copyright year.
1765 * readelf.c: Likewise.
1766 * size.c: Likewise.
1767 * nm.c: Likewise.
1768 * ld.c: Likewise.
1769 * elflint.c: Likewise.
1770
1771 * elflint.c (check_symtab): Don't warn about wrong size for
1772 _DYNAMIC and __GLOBAL_OFFSET_TABLE__ for --gnu-ld.
1773
17742004-10-05 Ulrich Drepper <drepper@redhat.com>
1775
1776 * readelf.c (print_phdr): In section mapping, also indicate
1777 sections in read-only segments.
1778
17792004-09-25 Ulrich Drepper <drepper@redhat.com>
1780
1781 * readelf.c: Make compile with gcc 4.0.
1782 * strip.c: Likewise.
1783
17842004-08-16 Ulrich Drepper <drepper@redhat.com>
1785
1786 * strip.c (handle_elf): Rewrite dynamic memory handling to use of
1787 allocate to work around gcc 3.4 bug.
1788
17892004-01-25 Ulrich Drepper <drepper@redhat.com>
1790
1791 * ldlex.l (invalid_char): Better error message.
1792
17932004-01-23 Ulrich Drepper <drepper@redhat.com>
1794
1795 * readelf.c: Print SHT_GNU_LIBLIST sections.
1796
1797 * none_ld.c: New file.
1798
17992004-01-21 Ulrich Drepper <drepper@redhat.com>
1800
1801 * Makefile.am: Enable building of machine specific linker.
1802
18032004-01-20 Ulrich Drepper <drepper@redhat.com>
1804
1805 * Makefile.am: Support building with mudflap.
1806
1807 * i386_ld.c: Fix warnings gcc 3.4 spits out.
1808 * ldgeneric.c: Likewise.
1809 * ldscript.y: Likewise.
1810 * readelf.c: Likewise.
1811 * strip.c: Likewise.
1812
1813 * readelf.c (print_debug_line_section): Determine address size
1814 correctly.
1815
18162004-01-19 Ulrich Drepper <drepper@redhat.com>
1817
1818 * readelf.c (print_phdr): Show which sections are covered by the
1819 PT_GNU_RELRO entry.
1820
1821 * elflint.c (check_program_header): Check PT_GNU_RELRO entry.
1822
1823 * readelf.c (print_debug_macinfo_section): Implement.
1824
18252004-01-18 Ulrich Drepper <drepper@redhat.com>
1826
1827 * readelf.c (print_debug_line_section): Implement.
1828
18292004-01-17 Ulrich Drepper <drepper@redhat.com>
1830
1831 * src/elflint.c: Use PACKAGE_NAME instead of PACKAGE.
1832 * src/ld.c: Likewise.
1833 * src/nm.c: Likewise.
1834 * src/readelf.c: Likewise.
1835 * src/size.c: Likewise.
1836 * src/strip.c: Likewise.
1837
1838 * strip.c: Add a few more unlikely. Reduce scope of some variables.
1839
1840 * Makefile.am: Support building with mudflap.
1841
18422004-01-16 Ulrich Drepper <drepper@redhat.com>
1843
1844 * readelf.c (print_debug_info_section): Free dies memory.
1845
1846 * readelf.c: Print .debug_info section content.
1847
18482004-01-13 Ulrich Drepper <drepper@redhat.com>
1849
1850 * readelf.c (print_shdr): Add support for SHF_ORDERED and SHF_EXCLUDE.
1851
18522004-01-12 Ulrich Drepper <drepper@redhat.com>
1853
1854 * readelf.c (print_debug_aranges): Implement using libdw.
1855
18562004-01-11 Ulrich Drepper <drepper@redhat.com>
1857
1858 * nm.c: Adjust for Dwarf_Files type and dwarf_lineno interface change.
1859
1860 * readelf.c: Use libdw instead of libdwarf. Not all of the old
1861 behavior is available yet.
1862 * Makefile.am: Link readelf with libdw. Remove libdwarf include path.
1863
18642004-01-09 Ulrich Drepper <drepper@redhat.com>
1865
1866 * nm.c (get_local_names): Adjust call to dwarf_nextcu.
1867
1868 * nm.c: Implement getting information about local variables.
1869
18702004-01-07 Ulrich Drepper <drepper@redhat.com>
1871
1872 * nm.c: Read also debug information for local symbols.
1873
18742004-01-05 Ulrich Drepper <drepper@redhat.com>
1875
1876 * nm.c: Shuffle dwarf handling code around so the maximum column
1877 width can be computed ahead of printing. Avoid collection symbols
1878 which are not printed anyway.
1879
1880 * nm.c: Rewrite dwarf handling to use libdw.
1881 * Makefile.am (AM_CFLAGS): Add -std parameter.
1882 (INCLUDES): Find header in libdw subdir.
1883 (nm_LDADD): Replace libdwarf with libdw.
1884
1885 * elflint.c: Update copyright year.
1886 * readelf.c: Likewise.
1887 * size.c: Likewise.
1888 * strip.c: Likewise.
1889 * nm.c: Likewise.
1890
18912003-12-31 Ulrich Drepper <drepper@redhat.com>
1892
1893 * strip.c (process_file): Close file before returning.
1894
18952003-11-19 Ulrich Drepper <drepper@redhat.com>
1896
1897 * readelf.c (handle_dynamic): Make column for tag name wider.
1898
18992003-09-29 Ulrich Drepper <drepper@redhat.com>
1900
1901 * readelf.c (handle_dynamic): Always terminate tag name with a space.
1902
19032003-09-25 Ulrich Drepper <drepper@redhat.com>
1904
1905 * strip.c (process_file): Don't mmap the input file, we modify the
1906 data structures and don't want the change end up on disk.
1907
19082003-09-23 Jakub Jelinek <jakub@redhat.com>
1909
1910 * unaligned.h (union u_2ubyte_unaligned,
1911 union u_4ubyte_unaligned, union u_8ubyte_unaligned): Add
1912 packed attribute.
1913 (add_2ubyte_unaligned, add_4ubyte_unaligned,
1914 add_8ubyte_unaligned): Avoid nesting bswap_NN macros.
1915 Read/store value through _ptr->u instead of *_ptr.
1916
19172003-09-22 Ulrich Drepper <drepper@redhat.com>
1918
1919 * size.c (show_sysv): Change type of maxlen to int.
1920
1921 * strip.c (handle_elf): Handle the 64-bit archs which is 64-bit
1922 buckets.
1923
1924 * i386_ld.c: Many many fixes and extensions.
1925 * ld.c: Likewise.
1926 * ldgeneric.c: Likewise.
1927
19282003-08-16 Ulrich Drepper <drepper@redhat.com>
1929
1930 * ldgeneric.c (check_definition): Don't add symbol on dso_list if
1931 the reference is from another DSO.
1932
19332003-08-15 Ulrich Drepper <drepper@redhat.com>
1934
1935 * ldgeneric.c (find_entry_point): It is no fatal error if no entry
1936 point is found when creating a DSO.
1937
19382003-08-14 Ulrich Drepper <drepper@redhat.com>
1939
1940 * ld.c (main): Always call FLAG_UNRESOLVED.
1941 * ldgeneric.c (ld_generic_flag_unresolved): Only complain about
1942 undefined symbols if not creating DSO or ld_state.nodefs is not set.
1943
19442003-08-13 Ulrich Drepper <drepper@redhat.com>
1945
1946 * Makefile.in: Depend on libebl.a, not libebl.so.
1947
1948 * ld.c (main): Mark stream for linker script as locked by caller.
1949 (read_version_script): Likewise.
1950 * ldlex.c: Define fread and fwrite to _unlocked variant.
1951
1952 * i386_ld.c (elf_i386_finalize_plt): Replace #ifdefs with uses of
1953 target_bswap_32.
1954 * unaligned.h: Define target_bswap_16, target_bswap_32, and
1955 target_bswap_64.
1956 (store_2ubyte_unaligned, store_4ubyte_unaligned,
1957 store_8ubyte_unaligned): Define using new macros.
1958
19592003-08-12 Ulrich Drepper <drepper@redhat.com>
1960
1961 * i386_ld.c (elf_i386_finalize_plt): Use packed structs to access
1962 possibly unaligned memory. Support use of big endian machines.
1963
19642003-08-11 Ulrich Drepper <drepper@redhat.com>
1965
1966 * Moved to CVS archive.