[PATCH] New option --print-gc-sections
Eric Botcazou
ebotcazou@adacore.com
Tue Mar 28 12:04:00 GMT 2006
Hi,
We'd like to introduce a --print-gc-sections option, to be used in conjunction
with --gc-sections, now that its output is accurate thanks to HJ's work.
The warning/error message format recently changed and is now one-lined, so I'm
proposing the following format:
1. "objfile:location GC function" for .text.function sections.
2. "objfile GC section" for other sections.
For example, on an Ada example with --print-gc-sections --demangle=gnat:
./u.o GC .text
./u.o GC .bss
./u.o:/home/eric/gnat/bugs/F115-010/u.adb:18 GC u.unused
./u.o GC .gcc_except_table.u__unused
./u.o:/home/eric/gnat/bugs/F115-010/u.adb:27 GC u.unused_2
./ma.o GC .text
./ma.o GC .data
./ma.o GC .bss
Tentative patch attached, tested on AMD64/Linux. Comments?
2006-03-28 Eric Botcazou <ebotcazou@adacore.com>
bfd/
* elflink.c (elf_gc_sweep): Invoke the gc_section link callback
on excluded sections.
include/
* bfdlink.h (struct bfd_link_info): New flag print_gc_sections.
(struct bfd_link_callbacks): New method gc_section.
ld/
* ld.texinfo (Command Line Options): Document --print-gc-sections.
* ldmain.c (gc_section): New callback.
(link_callbacks): Add gc_section.
* lexsup.c (enum option_values): New value OPTION_PRINT_GC_SECTIONS.
(ld_options): Add --print-gc-sections.
(parse_args): Handle OPTION_PRINT_GC_SECTIONS.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: f115-010_217.diff
Type: text/x-diff
Size: 5267 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20060328/0b678b03/attachment.bin>
More information about the Binutils
mailing list