comp.lang.ada
 help / color / mirror / Atom feed
From: Noel Duffy <hobcraft-usenet@yahooxtra.co.nz>
Subject: Re: Differences between gnat 4.4.5 and 4.5.1
Date: Mon, 21 Mar 2011 07:05:06 +0000 (UTC)
Date: 2011-03-21T07:05:06+00:00	[thread overview]
Message-ID: <im6tb1$f3t$1@news.eternal-september.org> (raw)
In-Reply-To: 87d3lltuw7.fsf@ludovic-brenta.org

On Sun, 20 Mar 2011 21:11:04 +0100, Ludovic Brenta wrote:

>> Personally I'd be inclined to think the difference in size is due to
>> the compiler, not differences between distributions.  I'd have to check
>> with gnat-4.5 when it reaches a usable state.
> 
> OK, I've got gnat-4.5 installed on my machine now (with all Debian
> patches ported).  Here are my results:
> 
[snipped for brevity]
> 
> Comparing the sizes of the sections shows a small increase in most
> sections and a move of most data from .data to .rodata.  The .text
> section, for example, has increased by 10%.

Thanks for taking the time to look into this. For comparison, here is the
objdump output I see for Fedora/gnat-4.5.1:


hello:     file format elf64-x86-64

Sections:
Idx Name          Size      VMA               LMA               File off  
Algn
  0 .interp       0000001c  0000000000400200  0000000000400200  00000200  
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .note.ABI-tag 00000020  000000000040021c  000000000040021c  0000021c  
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.gnu.build-id 00000024  000000000040023c  000000000040023c  
0000023c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .gnu.hash     000001a4  0000000000400260  0000000000400260  00000260  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00000900  0000000000400408  0000000000400408  00000408  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       000008fb  0000000000400d08  0000000000400d08  00000d08  
2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  000000c0  0000000000401604  0000000000401604  00001604  
2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000030  00000000004016c8  00000000004016c8  000016c8  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.dyn     00000420  00000000004016f8  00000000004016f8  000016f8  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .rela.plt     00000438  0000000000401b18  0000000000401b18  00001b18  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 10 .init         00000018  0000000000401f50  0000000000401f50  00001f50  
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .plt          000002e0  0000000000401f68  0000000000401f68  00001f68  
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .text         00004b08  0000000000402250  0000000000402250  00002250  
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 13 .fini         0000000e  0000000000406d58  0000000000406d58  00006d58  
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 14 .rodata       00000740  0000000000406d70  0000000000406d70  00006d70  
2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 15 .eh_frame_hdr 00000204  00000000004074b0  00000000004074b0  000074b0  
2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 16 .eh_frame     00000b4c  00000000004076b8  00000000004076b8  000076b8  
2**3
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 17 .gcc_except_table 00000024  0000000000408204  0000000000408204  
00008204  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 18 .ctors        00000010  0000000000608228  0000000000608228  00008228  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 19 .dtors        00000010  0000000000608238  0000000000608238  00008238  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 20 .jcr          00000008  0000000000608248  0000000000608248  00008248  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 21 .dynamic      000001a0  0000000000608250  0000000000608250  00008250  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 22 .got          00000010  00000000006083f0  00000000006083f0  000083f0  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 23 .got.plt      00000180  0000000000608400  0000000000608400  00008400  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 24 .data         00000010  0000000000608580  0000000000608580  00008580  
2**3
                  CONTENTS, ALLOC, LOAD, DATA
 25 .bss          000004a8  00000000006085a0  00000000006085a0  00008590  
2**5
                  ALLOC
 26 .comment      0000002c  0000000000000000  0000000000000000  00008590  
2**0
                  CONTENTS, READONLY

The .text section is noticeably larger in this executable, 0x4B08
(19208), than in the executable generated on Debian, 0x4c8. Since
.text is code, I ran objdump -S on the text sections in both
executables after recompiling but not stripping debug symbols. The
Fedora/gnat-4.5.1 executable has many more functions. Here is a list
of them.

$ objdump -S -j .text hello | egrep "^0[a-f0-9]+"
0000000000402250 <_start>:
000000000040227c <call_gmon_start>:
00000000004022a0 <__do_global_dtors_aux>:
0000000000402310 <frame_dummy>:
0000000000402334 <adainit>:
000000000040259d <adafinal>:
00000000004025a2 <main>:
00000000004025f4 <hello___clean.2354>:
000000000040261d <_ada_hello>:
00000000004026c0 <read_sleb128>:
0000000000402710 <read_encoded_value_with_base>:
0000000000402870 <init_dwarf_reg_size_table>:
00000000004028f0 <execute_cfa_program>:
00000000004031b0 <uw_frame_state_for>:
0000000000403860 <execute_stack_op>:
0000000000403f40 <uw_update_context_1>:
0000000000404300 <uw_update_context>:
00000000004043b0 <_Unwind_ForcedUnwind_Phase2>:
0000000000404480 <_Unwind_RaiseException_Phase2>:
0000000000404520 <uw_init_context_1>:
00000000004046d0 <uw_install_context_1>:
0000000000404840 <_Unwind_GetGR>:
0000000000404890 <_Unwind_GetCFA>:
00000000004048a0 <_Unwind_SetGR>:
00000000004048f0 <_Unwind_GetIP>:
0000000000404900 <_Unwind_GetIPInfo>:
0000000000404920 <_Unwind_SetIP>:
0000000000404930 <_Unwind_GetLanguageSpecificData>:
0000000000404940 <_Unwind_GetRegionStart>:
0000000000404950 <_Unwind_FindEnclosingFunction>:
0000000000404980 <_Unwind_GetDataRelBase>:
0000000000404990 <_Unwind_GetTextRelBase>:
00000000004049a0 <__frame_state_for>:
0000000000404ad0 <_Unwind_DebugHook>:
0000000000404ae0 <_Unwind_RaiseException>:
0000000000404c60 <_Unwind_ForcedUnwind>:
0000000000404d70 <_Unwind_Resume>:
0000000000404e60 <_Unwind_Resume_or_Rethrow>:
0000000000404f80 <_Unwind_DeleteException>:
0000000000404fa0 <_Unwind_Backtrace>:
0000000000405060 <fde_unencoded_compare>:
0000000000405080 <frame_downheap>:
0000000000405140 <frame_heapsort>:
0000000000405210 <size_of_encoded_value>:
0000000000405280 <read_encoded_value_with_base>:
00000000004053c0 <get_cie_encoding>:
0000000000405500 <base_from_object.clone.3>:
0000000000405570 <classify_object_over_fdes>:
00000000004056f0 <fde_single_encoding_compare>:
00000000004057a0 <linear_search_fdes>:
0000000000405930 <add_fdes.clone.4>:
0000000000405a80 <base_from_cb_data.clone.5>:
0000000000405af0 <search_object>:
00000000004061e0 <fde_mixed_encoding_compare>:
00000000004062b0 <_Unwind_IteratePhdrCallback>:
0000000000406770 <__register_frame_info_bases>:
0000000000406810 <__register_frame_info>:
0000000000406820 <__register_frame>:
0000000000406850 <__register_frame_info_table_bases>:
00000000004068d0 <__register_frame_info_table>:
00000000004068e0 <__register_frame_table>:
0000000000406900 <__deregister_frame_info_bases>:
0000000000406a40 <__deregister_frame_info>:
0000000000406a50 <__deregister_frame>:
0000000000406a80 <_Unwind_Find_FDE>:
0000000000406c80 <__libc_csu_init>:
0000000000406d10 <__libc_csu_fini>:
0000000000406d20 <__do_global_ctors_aux>:

There are 68 of them. The Debian/gnat-4.4.5 version contains just:

0000000000402100 <_start>:
000000000040212c <call_gmon_start>:
0000000000402150 <__do_global_dtors_aux>:
00000000004021c0 <frame_dummy>:
00000000004021e4 <adafinal>:
00000000004021e9 <adainit>:
00000000004023da <main>:
000000000040242c <hello___clean.2605>:
0000000000402455 <_ada_hello>:
00000000004024f0 <__libc_csu_fini>:
0000000000402500 <__libc_csu_init>:
0000000000402590 <__do_global_ctors_aux>:

A lot of the extra functions appear to be related to debugging and
generating backtraces. Not sure why they're still present when debugging
information is stripped. I suppose it's possible that Redhat want these
functions left in binaries for some reason, but that's just a guess. 

Time perhaps to take this to Fedora's mailing lists to see if they can
shed any light on it.



  reply	other threads:[~2011-03-21  7:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10  6:01 Differences between gnat 4.4.5 and 4.5.1 Noel Duffy
2011-03-10 13:48 ` Julian Leyh
2011-03-10 21:32   ` Mart van de Wege
2011-03-10 21:39     ` Ludovic Brenta
2011-03-11  9:16       ` Mart van de Wege
2011-03-20 20:11       ` Ludovic Brenta
2011-03-21  7:05         ` Noel Duffy [this message]
2011-03-21  7:52           ` Ludovic Brenta
2011-03-10 21:42     ` Noel Duffy
2011-03-10 21:36   ` Noel Duffy
2011-03-21  8:35 ` Dmitry A. Kazakov
2011-03-21 10:16   ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox