[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | VAX and Alpha VMS |
Notice: | This is a new VMSnotes, please read note 2.1 |
Moderator: | VAXAXP::BERNARDO |
|
Created: | Wed Jan 22 1997 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 703 |
Total number of notes: | 3722 |
538.0. "problems with shareable image on alpha " by GALVIA::FOX_F () Mon Apr 28 1997 05:55
This note was originally posted in ALPHANOTES and I moved it to here.
--------------------------------------------------------------------
I am having a problem with shareable images on an application port from
VAX to ALPHA. Maybe someone could help. I have tried to summarise the problem
below.
The code being ported was written in BASIC and MACRO.
The BASIC code needs to be able to write to the PSECT TDB which is
defined in MACRO and is part of the shareable image.
! Basic file maps a PSECT named TDB
MY_TEST.BAS
-----------
MAP ( TDB ) &
LONG TEST_LONG
! Link option file for MY_test is as follows
TESTOPT.OPT
-----------
MY$SHR.EXE/SHARE
! Macro File defines the PSECT name TDB
MY$DATA.MAR
-----------
.PSECT TDB PIC,USR,OVR,REL,GBL,SHR,NOEXE,RD,WRT,PAGE
INT_TDBADR:: .LONG 0 ; DEFINE SYMBOL FOR TDB
.END
! Shareable image built from MY$DATA.OBJ
MY$SHR.EXE
----------
$ LINK/NONATIVE/SYSEXE/DEBUG/SYM/TRACE/MAP=MY$SHR.MAP -
/FULL/CROSS/SHAREABLE=MY$SHR.EXE -
MY$DATA.OBJ + MYSHR/OPT
! Shareable option file looks like this
MYSHR.OPT
---------
PSECT_ATTR=TDB,SHR
! Build command file for all of the above
$ BASIC /OPTIMIZE/WARN/LIST/CROSS/DEBUG/OBJ=MY_TEST.OBJ MY_TEST.BAS
$ MACRO /MIGRATE /OBJ=MY$DATA.OBJ MY$DATA.MAR
$ LINK/NONATIVE/SYSEXE/DEBUG/SYM/TRACE/MAP=MY$SHR.MAP -
/FULL/CROSS/SHAREABLE=MY$SHR.EXE -
MY$DATA.OBJ + MYSHR/OPT
$ LINK/NONATIVE/SYSEXE/DEBUG/SYM/TRACE/MAP=MY_TEST.MAP/ -
FULL/CROSS/EXECUTEABLE=MY_TEST.EXE -
MY_TEST.OBJ + TESTOPT/OPT
----------------------------------------------------------------------
On the VAX when I look in the MAP files for MY_TEST and for MY$SHR the
address for the TDB section are the same. On the ALPHA they are not.
Can anyone point out what the attributes for the PSECTs should be for
the ALPHA.
I feel I should be using a symbol_vector in the myshr.opt file but
if I use the Psect name (TDB) the linker tells me I have an undefined symbol.
I tried the suggestion from the ALPHANOTES file of
symbol_vector=(TDB=psect, INT_TDBADR=data ) and that did not work either.
If I compile and link the code against a .OLB that contains the
TDB PSECT - the code works perfectly on the ALPHA it is only when the
shareable image is used that problems arise.
Thanks for any help.
Regards,
John.
T.R | Title | User | Personal Name | Date | Lines |
---|
538.1 | | CSC64::BLAYLOCK | If at first you doubt,doubt again. | Mon Apr 28 1997 12:18 | 19 |
|
The default for most languages on OpenVMS Alpha is to not include
the SHR option (it is not needed in most cases). Thus the
BASIC module TDB psect is different than the MACRO/Shareable image
psect. BASIC will also pad the MAP of TDB to 16 bytes, so you
get the error
%LINK-E-SHRPSCLNG, Psect TDB has length of 16
in module MY_TEST$MAIN file KGB$ROOT:[JUNK]MY_TEST.OBJ;1
which exceeds length of 4 in shareable image
KGB$ROOT:[JUNK]MY$SHR.EXE;4
%LINK-E-NOIMGFIL, image file not created
So you have to do two things (along with the symbol_vector).
Make the value of SHR consistant between modules and Pad out the Macro
module TDB psect. It might also help to align the MACRO psect
definition at an Octaword.
|
538.2 | thanks | GALVIA::FOX_F | | Wed Apr 30 1997 08:11 | 2 |
|
Yes, thanks a lot - that did the trick.
|