[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9861.0. "ld -om and ada" by NNTPD::"[email protected]" (Adrian Morrisson) Sun May 18 1997 20:44

Hi
	I have a customer who had a question about ld and the -om switch
"We are using the Apex compiler supplied by Rational to build Ada 83
>executables under DEC UNIX 3.2X/4.0X. The build environment calls the DEC
>linker, ld. Depending on the switches used to compile, ld appears to be
>called either directly or via cc. I have found some information from DEC on
>the -om switch which performs post-link optimisation. I thought this might
>work on executables generated from Ada 83 as by post-link time no matter what
>the original source I'd expect the exe to be in DEC's extended COFF. I passed
>the -om switch to the Rational compiler which in turn passed it to ld. The
>link phase finished without error report. Examination of the exe with the
>size -A command revealed that several sections of the executable had been
>either removed or substantially reduced in size. Unfortunately, the exe
>dumped core when run. (It ran perfectly well before I let -om loose on it.)
>
>So I guess I need to know if I can use -om on executables generated from Ada
>83. The cc man page does say that the -om switch must be used with cc. I
>think I can sort out the Apex environment so that Apex calls cc with this
>switch at build. But will this object modification stuff work with Ada
>executables?"

Has anyone got any suggestions etc?


Thanks


Adrian

[Posted by WWW Notes gateway]
T.RTitleUserPersonal
Name
DateLines
9861.1QUARRY::nethCraig NethMon May 19 1997 11:1027
ld -om doesn't actually run om, the post-link optimizer; all it does is 
prepare the input file so that the /usr/lib/cmplrs/cc/om image can be 
run on it.   So it's not suprising that using ld -om by iteself didn't 
give you anything useful.

Here's what 'cc -om' does:

> cc hello.c -om -non_shared -v
/usr/lib/cmplrs/cc/gemc_cc -D__LANGUAGE_C__ -D__unix__ -D__osf__ -D__alpha 
-D_SYSTYPE_BSD -D_LONGLONG -D__digital__ -D__arch64__ -DLANGUAGE_C -Dunix 
-DSYSTYPE_BSD -I/usr/include -preempt_module -g0 -O2 -std0 -o hello.o hello.c
/usr/lib/cmplrs/cc/gemc_cc:
0.07u 0.02s 0:00 56% 0+8k 0+20io 0pf+0w 8stk+1216mem
/usr/lib/cmplrs/cc/ld -g0 -O1 -non_shared /usr/lib/cmplrs/cc/crt0.o hello.o
-lc -om -o /tmp/ctmomaaunwa
/usr/lib/cmplrs/cc/ld:
0.02u 0.05s 0:01 5% 0+7k 136+41io 0pf+0w 7stk+1216mem
/usr/lib/cmplrs/cc/om /tmp/ctmomaaunwa -g0 -O1 -non_shared
/usr/lib/cmplrs/cc/om:
0.48u 0.04s 0:00 57% 0+15k 68+25io 0pf+0w 15stk+1936mem

So, you need to find a way (either by using cc -om) or just directly
running the om image on the output of the ld -om command.

I am not aware of any problems with using om with Apex ADA, but I'm not
sure I know of anybody using the two together either.    Let us know how
things come out.