This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch]: Print size of discarded sections
On Jun 25, 2009, at 3:30 AM, Alan Modra wrote:
I'd recommend adding a
parameter to print_input_section in order to print sizes just for
the list of discarded sections.
Thanks.
What about this new patch ? (No regression on x86_64-linux).
ld/
2009-06-25 Tristan Gingold <gingold@adacore.com>
* ldlang.c (print_input_section): Add is_discarded parameter. Adjust
prototype.
(lang_map): Print the size of discarded sections.
(print_statement): Adjust call to print_input_section.
diff -c -p -r1.310 ldlang.c
*** ld/ldlang.c 26 May 2009 01:20:39 -0000 1.310
--- ld/ldlang.c 25 Jun 2009 12:58:53 -0000
*************** static void print_statement (lang_statem
*** 78,84 ****
static void print_statement_list (lang_statement_union_type *,
lang_output_section_statement_type *);
static void print_statements (void);
! static void print_input_section (asection *);
static bfd_boolean lang_one_common (struct bfd_link_hash_entry *,
void *);
static void lang_record_phdrs (void);
static void lang_do_version_exports_section (void);
--- 78,84 ----
static void print_statement_list (lang_statement_union_type *,
lang_output_section_statement_type *);
static void print_statements (void);
! static void print_input_section (asection *, bfd_boolean);
static bfd_boolean lang_one_common (struct bfd_link_hash_entry *,
void *);
static void lang_record_phdrs (void);
static void lang_do_version_exports_section (void);
*************** lang_map (void)
*** 1917,1923 ****
dis_header_printed = TRUE;
}
! print_input_section (s);
}
}
--- 1917,1923 ----
dis_header_printed = TRUE;
}
! print_input_section (s, TRUE);
}
}
*************** print_all_symbols (asection *sec)
*** 3957,3963 ****
/* Print information about an input section to the map file. */
static void
! print_input_section (asection *i)
{
bfd_size_type size = i->size;
int len;
--- 3957,3963 ----
/* Print information about an input section to the map file. */
static void
! print_input_section (asection *i, bfd_boolean is_discarded)
{
bfd_size_type size = i->size;
int len;
*************** print_input_section (asection *i)
*** 3986,3992 ****
else
{
addr = print_dot;
! size = 0;
}
minfo ("0x%V %W %B\n", addr, TO_ADDR (size), i->owner);
--- 3986,3993 ----
else
{
addr = print_dot;
! if (!is_discarded)
! size = 0;
}
minfo ("0x%V %W %B\n", addr, TO_ADDR (size), i->owner);
*************** print_statement (lang_statement_union_ty
*** 4281,4287 ****
print_reloc_statement (&s->reloc_statement);
break;
case lang_input_section_enum:
! print_input_section (s->input_section.section);
break;
case lang_padding_statement_enum:
print_padding_statement (&s->padding_statement);
--- 4282,4288 ----
print_reloc_statement (&s->reloc_statement);
break;
case lang_input_section_enum:
! print_input_section (s->input_section.section, FALSE);
break;
case lang_padding_statement_enum:
print_padding_statement (&s->padding_statement);