This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: crosstool bloat




Dave Korn wrote:
----Original Message----

From: Dave Korn
Sent: 19 September 2005 15:26


----Original Message----

From: Peter Barada
Sent: 19 September 2005 15:17

That's exactly what I did, and the bloated one had an additional
section:


Idx Name          Size      VMA       LMA       File off  Algn
10 .MIPS.stubs   000000a0  00400e50  00400e50  00000e50  2**2

but I don't know what this really means.

That section size is only 160 bytes in size. What section is the other 60k in?


Yep, post the full output from "objdump -x".

^^^^^^^^^^^^



... from both before and after versions of your simplest 'hello world' testcase. (should have been clearer about that first time round).


cheers, DaveK


You guys are my heroes. I wrote a simple hello world program. Here are the executable sizes:

-rwxr-xr-x  1 dkarlton users  9956 2005-09-19 10:55 hello.3.2.3
-rwxr-xr-x  1 dkarlton users 71522 2005-09-19 10:54 hello.3.3.4
-rw-r--r--  1 dkarlton users    75 2005-09-19 10:53 hello.c
-rwxr-xr-x  1 dkarlton users  8671 2005-09-19 10:54 hello.x86


And here's the output from 'objdump -x' for the bloated version:


*******************************************

dkarlton@fox:~/test> objdump -x hello.3.3.4

hello.3.3.4:     file format elf32-little
hello.3.3.4
architecture: UNKNOWN!, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00400600

Program Header:
    PHDR off    0x00000034 vaddr 0x00400034 paddr 0x00400034 align 2**2
         filesz 0x000000e0 memsz 0x000000e0 flags r-x
  INTERP off    0x00000114 vaddr 0x00400114 paddr 0x00400114 align 2**0
         filesz 0x0000000d memsz 0x0000000d flags r--
0x70000000 off    0x00000144 vaddr 0x00400144 paddr 0x00400144 align 2**2
         filesz 0x00000018 memsz 0x00000018 flags r--
    LOAD off    0x00000000 vaddr 0x00400000 paddr 0x00400000 align 2**16
         filesz 0x00000ac0 memsz 0x00000ac0 flags r-x
    LOAD off    0x00010000 vaddr 0x10000000 paddr 0x10000000 align 2**16
         filesz 0x00000090 memsz 0x000000a0 flags rw-
 DYNAMIC off    0x0000015c vaddr 0x0040015c paddr 0x0040015c align 2**2
         filesz 0x000003a6 memsz 0x000003a6 flags rwx
    NOTE off    0x00000124 vaddr 0x00400124 paddr 0x00400124 align 2**2
         filesz 0x00000020 memsz 0x00000020 flags r--

Dynamic Section:
  NEEDED      libgcc_s.so.1
  NEEDED      libc.so.6
  INIT        0x400548
  FINI        0x400a40
  HASH        0x400254
  STRTAB      0x400408
  SYMTAB      0x4002e8
  STRSZ       0xfa
  SYMENT      0x10
  0x70000016  0x10000020
  DEBUG       0x0
  PLTGOT      0x10000040
  REL         0x0
  RELSZ       0x0
  RELENT      0x8
  0x70000001  0x1
  0x70000005  0x2
  0x70000006  0x400000
  0x7000000a  0x7
  0x70000011  0x12
  0x70000012  0x1f
  0x70000013  0x5
  VERNEED     0x400528
  VERNEEDNUM  0x1
  VERSYM      0x400502

Version References:
  required from libc.so.6:
    0x0d696910 0x00 02 GLIBC_2.0

Sections:
Idx Name Size VMA LMA File off Algn
0 .interp 0000000d 00400114 00400114 00000114 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .note.ABI-tag 00000020 00400124 00400124 00000124 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynamic 000000f8 0040015c 0040015c 0000015c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .hash 00000094 00400254 00400254 00000254 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .dynsym 00000120 004002e8 004002e8 000002e8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .dynstr 000000fa 00400408 00400408 00000408 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .gnu.version 00000024 00400502 00400502 00000502 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .gnu.version_r 00000020 00400528 00400528 00000528 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .init 000000ac 00400548 00400548 00000548 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
9 .text 00000410 00400600 00400600 00000600 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .MIPS.stubs 00000030 00400a10 00400a10 00000a10 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .fini 0000005c 00400a40 00400a40 00000a40 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
12 .rodata 00000020 00400aa0 00400aa0 00000aa0 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
13 .data 00000020 10000000 10000000 00010000 2**4
CONTENTS, ALLOC, LOAD, DATA
14 .rld_map 00000004 10000020 10000020 00010020 2**2
CONTENTS, ALLOC, LOAD, DATA
15 .eh_frame 00000004 10000024 10000024 00010024 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
16 .ctors 00000008 10000028 10000028 00010028 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .dtors 00000008 10000030 10000030 00010030 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .jcr 00000004 10000038 10000038 00010038 2**2
CONTENTS, ALLOC, LOAD, DATA
19 .got 00000050 10000040 10000040 00010040 2**4
CONTENTS, ALLOC, LOAD, DATA
20 .sbss 00000000 10000090 10000090 00010090 2**0
ALLOC
21 .bss 00000010 10000090 10000090 00010090 2**4
ALLOC
22 .comment 0000007e 00000000 00000000 00010090 2**0
CONTENTS, READONLY
23 .pdr 00000060 00000000 00000000 00010488 2**2
CONTENTS, READONLY
24 .mdebug.abi32 00000000 00000000 00000000 000104e8 2**0
CONTENTS, READONLY
SYMBOL TABLE:
00400114 l d .interp 00000000
00400124 l d .note.ABI-tag 00000000
00400144 l d *ABS* 00000000
0040015c l d .dynamic 00000000
00400254 l d .hash 00000000
004002e8 l d .dynsym 00000000
00400408 l d .dynstr 00000000
00400502 l d .gnu.version 00000000
00400528 l d .gnu.version_r 00000000
00400548 l d .init 00000000
00400600 l d .text 00000000
00400a10 l d .MIPS.stubs 00000000
00400a40 l d .fini 00000000
00400aa0 l d .rodata 00000000
10000000 l d .data 00000000
10000020 l d .rld_map 00000000
10000024 l d .eh_frame 00000000
10000028 l d .ctors 00000000
10000030 l d .dtors 00000000
10000038 l d .jcr 00000000
10000040 l d .got 00000000
10000090 l d .sbss 00000000
10000090 l d .bss 00000000
00000000 l d .comment 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l d .pdr 00000000
00000000 l d .mdebug.abi32 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/config.h
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 <built-in>
00400658 l .text 00000000 hlt
00000000 l df *ABS* 00000000 abi-note.S
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/abi-tag.h
00000000 l df *ABS* 00000000 abi-note.S
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/config.h
00000000 l df *ABS* 00000000 abi-note.S
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/config.h
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 <built-in>
00000000 l df *ABS* 00000000 abi-note.S
00000000 l df *ABS* 00000000 init.c
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crti.S
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/defs.h
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crti.S
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/config.h
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 <built-in>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crti.S
00400660 l F .text 00000000 call_gmon_start
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/gcc-3.3.4/gcc/crtstuff.c
10000028 l O .ctors 00000000 __CTOR_LIST__
10000030 l O .dtors 00000000 __DTOR_LIST__
10000038 l O .jcr 00000000 __JCR_LIST__
10000014 l O .data 00000000 p.0
10000090 l O .bss 00000001 completed.1
004006b0 l F .text 00000000 __do_global_dtors_aux
00400770 l F .text 00000000 frame_dummy
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/gcc-3.3.4/gcc/crtstuff.c
1000002c l O .ctors 00000000 __CTOR_END__
10000034 l O .dtors 00000000 __DTOR_END__
10000024 l O .eh_frame 00000000 __FRAME_END__
10000038 l O .jcr 00000000 __JCR_END__
00400980 l F .text 00000000 __do_global_ctors_aux
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crtn.S
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/defs.h
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crtn.S
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/config.h
00000000 l df *ABS* 00000000 <command line>
00000000 l df *ABS* 00000000 <built-in>
00000000 l df *ABS* 00000000 /home/dkarlton/crosstool-0.38/build/mipsel-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/build-glibc/csu/crtn.S
00000000 l df *ABS* 00000000 hello.c
00000000 l df *ABS* 00000000 elf-init.c
10000000 g .data 00000000 _fdata
10008030 g d *ABS* 00000000 _gp_disp
00000001 g d *ABS* 00000000 _DYNAMIC_LINKING
0040015c g O .dynamic 00000000 _DYNAMIC
10008030 g *ABS* 00000000 _gp
10000000 g *ABS* 00000000 __fini_array_end
10000010 g O .data 00000000 .hidden __dso_handle
004008e0 g F .text 00000000 __libc_csu_fini
00400548 g F .init 00000000 _init
00400600 g F .text 00000000 __start
00400600 g .text 00000000 _ftext
10000020 g O .rld_map 00000000 __RLD_MAP
10000000 g *ABS* 00000000 __fini_array_start
00400840 g F .text 00000000 __libc_csu_init
10000090 g *ABS* 00000000 __bss_start
004007e0 g F .text 00000000 main
00400a10 F *UND* 00000000 __libc_start_main@@GLIBC_2.0
10000000 g *ABS* 00000000 __init_array_end
10000000 w O .data 00000000 data_start
00400a20 F *UND* 00000000 printf@@GLIBC_2.0
00400a40 g F .fini 00000000 _fini
10000090 g *ABS* 00000000 _edata
10000040 g O .got 00000000 _GLOBAL_OFFSET_TABLE_
100000a0 g *ABS* 00000000 _end
10000000 g *ABS* 00000000 __init_array_start
00400aa0 g O .rodata 00000004 _IO_stdin_used
10000000 g O .data 00000000 __data_start
00000000 w *UND* 00000000 _Jv_RegisterClasses
10000090 g *ABS* 00000000 _fbss
00000000 w *UND* 00000000 __gmon_start__



------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]