Article View: gnu.utils.bug
Article #1190Re: patch for binutils/size.c to print unsigned long rather than ints
From: bothner
Date: Mon, 14 Dec 1992 14:58
Date: Mon, 14 Dec 1992 14:58
131 lines
4073 bytes
4073 bytes
> One could argue that bfd_size_type is more appropriate in some
> situations.
I think so, so that is what I did.
Please try the appended patch instead.
--Per Bothner
Cygnus Support bothner@cygnus.com
===================================================================
RCS file: /rel/cvsfiles/devo/binutils/size.c,v
retrieving revision 1.11
diff -c -r1.11 size.c
*** 1.11 1992/11/05 12:01:43
--- size.c 1992/12/15 06:53:20
***************
*** 234,251 ****
/* This is what lexical functions are for */
void
lprint_number (width, num)
! int width, num;
{
! printf ((radix == decimal ? "%-*d\t" :
! ((radix == octal) ? "%-*o\t" : "%-*x\t")), width, num);
}
void
rprint_number(width, num)
! int width, num;
{
! printf ((radix == decimal ? "%*d\t" :
! ((radix == octal) ? "%*o\t" : "%*x\t")), width, num);
}
static char *bss_section_name = ".bss";
--- 234,253 ----
/* This is what lexical functions are for */
void
lprint_number (width, num)
! int width;
! bfd_size_type num;
{
! printf ((radix == decimal ? "%-*ld\t" :
! ((radix == octal) ? "%-*lo\t" : "%-*lx\t")), width, (long)num);
}
void
rprint_number(width, num)
! int width;
! bfd_size_type num;
{
! printf ((radix == decimal ? "%*ld\t" :
! ((radix == octal) ? "%*lo\t" : "%*lx\t")), width, (long)num);
}
static char *bss_section_name = ".bss";
***************
*** 260,269 ****
sec_ptr bsssection = NULL;
sec_ptr datasection = NULL;
sec_ptr textsection = NULL;
! unsigned long bsssize = 0;
! unsigned long datasize = 0;
! unsigned long textsize = 0;
! unsigned long total = 0;
if ((textsection = bfd_get_section_by_name (abfd, text_section_name))
--- 262,271 ----
sec_ptr bsssection = NULL;
sec_ptr datasection = NULL;
sec_ptr textsection = NULL;
! bfd_size_type bsssize = 0;
! bfd_size_type datasize = 0;
! bfd_size_type textsize = 0;
! bfd_size_type total = 0;
if ((textsection = bfd_get_section_by_name (abfd, text_section_name))
***************
*** 302,308 ****
lprint_number (7, textsize);
lprint_number (7, datasize);
lprint_number (7, bsssize);
! printf (((radix == octal) ? "%-7o\t%-7x\t" : "%-7d\t%-7x\t"), total, total);
fputs(bfd_get_filename(abfd), stdout);
if (abfd->my_archive) printf (" (ex %s)", abfd->my_archive->filename);
--- 304,311 ----
lprint_number (7, textsize);
lprint_number (7, datasize);
lprint_number (7, bsssize);
! printf (((radix == octal) ? "%-7lo\t%-7lx\t" : "%-7ld\t%-7lx\t"),
! (long)total, (long)total);
fputs(bfd_get_filename(abfd), stdout);
if (abfd->my_archive) printf (" (ex %s)", abfd->my_archive->filename);
***************
*** 309,315 ****
}
/* I REALLY miss lexical functions! */
! int svi_total = 0;
void
sysv_internal_printer(file, sec, ignore)
--- 312,318 ----
}
/* I REALLY miss lexical functions! */
! bfd_size_type svi_total = 0;
void
sysv_internal_printer(file, sec, ignore)
***************
*** 317,323 ****
sec_ptr sec;
PTR ignore;
{
! int size = bfd_section_size (file, sec);
if (sec!= &bfd_abs_section
&& sec!= &bfd_com_section
&& sec!=&bfd_und_section)
--- 320,326 ----
sec_ptr sec;
PTR ignore;
{
! bfd_size_type size = bfd_section_size (file, sec);
if (sec!= &bfd_abs_section
&& sec!= &bfd_com_section
&& sec!=&bfd_und_section)
Technical Details
Message-ID:
<9212150658.AA12985@rtl.cygnus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!bothnerReferences:
<KEVIN.92Dec11203345@polkacide.tamri.com>Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cygnus.com!bothner From: bothner@cygnus.com Subject: Re: patch for binutils/size.c to print unsigned long rather than ints Message-ID: <9212150658.AA12985@rtl.cygnus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet References: <KEVIN.92Dec11203345@polkacide.tamri.com> Distribution: gnu Date: Mon, 14 Dec 1992 14:58:24 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 132