Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* How to shrink binaries?  ("relocation truncated to fit: LITERAL" problem.)
@ 2000-04-14 12:44 Harvey J. Stein
  0 siblings, 0 replies; 2+ messages in thread
From: Harvey J. Stein @ 2000-04-14 12:44 UTC (permalink / raw)
  To: axp-list; +Cc: hjstein


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* How to shrink binaries?  ("relocation truncated to fit: LITERAL" problem.)
@ 2000-04-14 13:06 Harvey J. Stein
  0 siblings, 0 replies; 2+ messages in thread
From: Harvey J. Stein @ 2000-04-14 13:06 UTC (permalink / raw)
  To: axp-list


(Sorry if you get this twice - I'm having trouble with mail from one
system, so I'm sending it from another one too.)

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-14 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-04-14 12:44 How to shrink binaries? ("relocation truncated to fit: LITERAL" problem.) Harvey J. Stein
  -- strict thread matches above, loose matches on Subject: below --
2000-04-14 13:06 Harvey J. Stein

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