From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c4ab69bf7d3638f1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!213.75.85.109.MISMATCH!newsfeed.kpn.net!pfeed09.wxs.nl!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Noel Duffy Newsgroups: comp.lang.ada Subject: Re: Differences between gnat 4.4.5 and 4.5.1 Date: Mon, 21 Mar 2011 07:05:06 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <86tyfa3bmz.fsf@gareth.avalon.lan> <87mxl2vemt.fsf@ludovic-brenta.org> <87d3lltuw7.fsf@ludovic-brenta.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 21 Mar 2011 07:05:06 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="R49CJtZYrYasPVqTyVC23Q"; logging-data="15485"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191Xf7Y8N5wvYHCg3fI7NE071cFSQRq63c=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:wFTV3yFCuBbA0sDEkDLvYf3hpDg= Xref: g2news2.google.com comp.lang.ada:19310 Date: 2011-03-21T07:05:06+00:00 List-Id: 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 : 00000000004022a0 <__do_global_dtors_aux>: 0000000000402310 : 0000000000402334 : 000000000040259d : 00000000004025a2
: 00000000004025f4 : 000000000040261d <_ada_hello>: 00000000004026c0 : 0000000000402710 : 0000000000402870 : 00000000004028f0 : 00000000004031b0 : 0000000000403860 : 0000000000403f40 : 0000000000404300 : 00000000004043b0 <_Unwind_ForcedUnwind_Phase2>: 0000000000404480 <_Unwind_RaiseException_Phase2>: 0000000000404520 : 00000000004046d0 : 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 : 0000000000405080 : 0000000000405140 : 0000000000405210 : 0000000000405280 : 00000000004053c0 : 0000000000405500 : 0000000000405570 : 00000000004056f0 : 00000000004057a0 : 0000000000405930 : 0000000000405a80 : 0000000000405af0 : 00000000004061e0 : 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 : 0000000000402150 <__do_global_dtors_aux>: 00000000004021c0 : 00000000004021e4 : 00000000004021e9 : 00000000004023da
: 000000000040242c : 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.