Operating System - OpenVMS
1748123 Members
3274 Online
108758 Solutions
New Discussion юеВ

ADA on Alpha: obj lib problem

 
Fridrik Marteinsson
Occasional Contributor

ADA on Alpha: obj lib problem

We at Kogun hf. Iceland are migrating from old Vax-es to Alpha platform for a big military system. We have following problem when creating object library.

The old platform is VAX 6000 with VAX/VMS V6.1 and ACS (Dec ADA V3.0A-9 without the Porfess. Devel. Option) the new one is Alpha with OpenVMS V7.3-1 and ACS (Dec ADA V3. 5A-23 with the Profess Devel. Option).

To describe the problem I use the ADA unit comm_msg_transfer_adaption_pkg which is kept in two files, the specification in comm_msg_transfer_adaption_pkg_.ada and the body in comm_msg_transfer_adaption_pkg.ada. After compilation I have two object files on both platforms, comm_msg_transfer_adaption_pkg_.obj and comm_msg_transfer_adaption_pkg.obj.

Now when I insert those two objects into a object library to be used in the Linking process two entries are created on the old platform but only one on the new. After analysing the object files (Analyze/object) I saw that in the case of the old system the s.k module name is hashed into ADA$CMM_MSG_TRNS__75DF7C52$ and ADA$CMM_MSG_TRNS__FCF4EFE0$ and those names are put into the object library. In the case of the new Alpha platform the object names are simply the first 31 characters of the unit name resulting in COMM_MSG_TRANSFER_ADAPTION_PK for both object modules resulting in elevation of the first one entered into the object library.

This problem means that I can not use object libraries but I can link by using all the object files in the ADA lib which usually is slower.

Regards, Fridrik Marteinsson
7 REPLIES 7
John Gillings
Honored Contributor

Re: ADA on Alpha: obj lib problem

Fridrik,

This seems to be a slight variation on the question you asked before at:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=647132

My answer is pretty much the same - please call your local customer support centre.

"I'm a bit puzzled by your assertion that linking is faster using an object library than directly linking all the object modules. Logic would say that using a library involves extra processing to search for symbol names, and therefore should take longer than simple "include this object file" operations. Also note that ADA object files can contain multiple object modules. Inserting the file into a library will decouple the modules, and may result in critical code missing from the final image because there are no link time references

This kind of issue doesn't work well in this forum because it requires too much question/answer to diagnose the cause. Please log a case with your customer support centre, with a prepared example. Expect to be asked for the complete transcript of the compile and link commands, including the complete text of all error messages. "
A crucible of informative mistakes
Brad McCusker
Respected Contributor

Re: ADA on Alpha: obj lib problem

Fridrik,

I showed this problem statement to the VMS ADA project leader (who happens to sit a few cubes away), and he said almost exactly what John has already said - You need to contact the CSC and let them work with you on a solution.

Good luck,

Brad McCusker
Brad McCusker
Software Concepts International
Fridrik Marteinsson
Occasional Contributor

Re: ADA on Alpha: obj lib problem

Thanks John and Brad. The reason I put this question back here is simply because after my research I thougt this would either have a simple answere or some patch to correct the problem. As for the puzzel bit John, when you have say thousand object files in ADA library it is faster to put them all into one object library before linking because of the file system overhead. In both cases all references have to be solved. And Brad please show this again to the ADA guy, I'm sure he know how to handle this. Regards from Iceland FM.
Craig A Berry
Honored Contributor

Re: ADA on Alpha: obj lib problem

I think Fridrik is right about linking using object libraries being faster than linking separate object files. For one thing, object libraries have a global symbol table, so to resolve a symbol, the linker can do a key lookup on the symbol's name in the table without even knowing what module it's in instead of serially rooting through a potentially large number of files.
John Gillings
Honored Contributor

Re: ADA on Alpha: obj lib problem

Craig, Fridrik,

>I think Fridrik is right about linking using object libraries being faster than linking separate object files.

Obviously there will be cases either way, but consider, I have N object modules that I know make up a specific image. In one case, I just say to the linker "take these object files and link them together". The files are read and linked, THEN the linker goes looking for undefined symbols.

On the other hand, I take the same N modules, and place them in a library. I give the linker the main image and the library. It then needs to go searching immediately. That's overhead! (not to mention the overhead of creating the library in the first place). End to end, I think you'll find that if you already KNOW the modules involved in the image, you may as well just link them all.

That's not to say libraries aren't useful! Quite the contrary, but their forte is storing common components which may be used in multiple images, where the overheads of maintaining the library and searching for the module are amortised over many LINKs.

Ada is also a special case because a single compilation unit ("package") may generate multiple object modules which might not be directly referenced, but are still required to be included in the final image. By directly including the object FILE (potentially containing multiple MODULES) in the LINK command, all MODULES are explicitly included in the output image, regardless of references. If the same FILE is inserted into a LIBRARY, the MODULES become independent and will only be included in the output image if explicitly referenced. That's why Ada provides its own library like functions.

Without proper diagnosis (which really can't be done in this format), I don't think it's possible to give proper advice, so again, I ask Fridrik to please contact his local Customer Support Centre.
A crucible of informative mistakes
Brad McCusker
Respected Contributor

Re: ADA on Alpha: obj lib problem

Fridrik -

The engineer agrees with what John is saying - contact Customer Support and work it through those channels. The engineer can not effectively work this issue through this medium.

Brad
Brad McCusker
Software Concepts International
Charlie McCutcheon
New Member

Re: ADA on Alpha: obj lib problem

Hi, I'm the Ada engineer referred to in earlier updates. I don't usually get into this forum, so I may not see any replies.

I met with some of your coworkers about a year ago, when they came to Nashua, NH.

Please report this through the official channels, with a reproducer. I seem to be reproducing the issue, but like to make sure I'm working the correct problem you're seeing.

The object module naming may be a fundimental difference between VAX and Alpha targets, based on my minimal analysis. I see a difference which seems to be what you report in DEC Ada V3.0A-7, as well as the supported V3.5A-23.

I'd need to research if this is a desired difference, or whether its merely due to using different code generators on VAX and Alpha targets.

I don't recall this issue being reported before. That makes me hesitant to make a change like this without adequate analysis.

Charlie McCutcheon
Ada engineering