From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 21413 invoked from network); 13 Apr 2000 14:11:30 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 13 Apr 2000 14:11:30 -0000 Received: from mh2dmz3.bloomberg.net (mh2dmz3.bloomberg.net [206.156.53.152]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id KAA21239 for ; Thu, 13 Apr 2000 10:11:24 -0400 Received: from mh3ny.bloomberg.com by mh2dmz3.bloomberg.net with ESMTP for axp-list@redhat.com; Thu, 13 Apr 2000 10:10:49 -0400 Received: from blinky.bloomberg.com by mh3ny.bloomberg.com with ESMTP; Thu, 13 Apr 2000 10:09:07 -0400 Received: (from hjstein@localhost) by blinky.bloomberg.com (8.9.3/8.9.3) id KAA32247; Thu, 13 Apr 2000 10:10:46 -0400 X-Authentication-Warning: blinky.bloomberg.com: hjstein set sender to hjstein@bfr.co.il using -f Sender: hjstein@blinky.bloomberg.com To: axp-list@redhat.com Subject: How to shrink binaries? CC: hjstein@bfr.co.il, Sasha From: hjstein@bfr.co.il (Harvey J. Stein) Date: 13 Apr 2000 10:10:46 -0400 In-Reply-To: Richard Henderson's message of "Tue, 11 Apr 2000 12:15:19 -0700" Message-Id: X-Mailer: Gnus v5.7/Emacs 20.4 My binary just got too big on Redhat 4.2. When I link I start seeing gobs & gobs "relocation truncated to fit" errors, as in: /usr/lib/crtend.o: In function `__do_global_ctors_aux': ../sysdeps/alpha/elf/crtend.S:73: relocation truncated to fit: LITERAL __CTOR_END__ ../sysdeps/alpha/elf/crtend.S:73: relocation truncated to fit: LITERAL __do_global_ctors_aux /usr/lib/libpvm3.a(lpvm.o): In function `pvmbeatask': /usr/src/redhat/BUILD/pvm3/src/LINUXALPHA/../../src/lpvm.c:2956: relocation truncated to fit: LITERAL $C123 /usr/src/redhat/BUILD/pvm3/src/LINUXALPHA/../../src/lpvm.c:2965: relocation truncated to fit: LITERAL $C124 /usr/src/redhat/BUILD/pvm3/src/LINUXALPHA/../../src/lpvm.c:2970: relocation truncated to fit: LITERAL $C125 /usr/src/redhat/BUILD/pvm3/src/LINUXALPHA/../../src/lpvm.c:2980: relocation truncated to fit: LITERAL $C126 I realize this has to do with one of the ELF sections getting too big, and it can be worked around by either upgrading to RH 5 or later, or making some of the libraries shared. For various reasons, I don't want to get into that right now. For one thing they'd both be fairly significant changes to our system & would require lots of testing time to prove out, and I really need to move these new binaries now. So, I'd much prefer to just cut out some of the application code I'm familiar with in an effort to get under the limits. So, what exactly is in this ELF section that's overflowing? Do I need to get rid of global symbols, or will making global structures & functions smaller also help? Is there anything else in this section that I can decrease by tweaking the code? How can I see exactly what it's trying to put in this section so as to see how much I have to get rid of? If this doesn't help, is there a sort of minimal upgrade path I can use on RH4.2 to get it to the point where it'll split up this section? Finally, when I use nm on some of my libraries, I see some weird stuff: [randy pascal-1.27]$ nm ApiUser/libapiuser_opt.a | head -20 bf_callback.o: 0000000000000000 r $C33 0000000000000008 r $C34 0000000000000010 r $C35 0000000000000020 r $C36 0000000000000018 r $C37 0000000000000028 r $C38 0000000000000030 r $C39 0000000000000038 r $C40 0000000000000040 r $C41 0000000000000048 r $C42 0000000000000050 r $C43 0000000000000058 r $C44 0000000000000000 a *ABS* 0000000000000000 t __gnu_compiled_c 0000000000000300 d bf_current_seq_num 0000000000000000 T bf_default_parameters 0000000000000008 t bf_default_parameters..ng I don't see these weird $Cxx symbols when I build under RH5.2 (yes, I've got a bunch of RH4.2s I can't upgrade & a bunch of RH5.2s which are ok with the code). What are these? These aren't the only weird extra symbols I see on RH4.2 vs RH5.2. Would getting rid of these things help? Also, what are these weird ..ng symbols that are showing up? They're not on RH5.2 either. Thanks, -- Harvey Stein Bloomberg LP hjstein@bfr.co.il