Operating System - OpenVMS
1748162 Members
3658 Online
108758 Solutions
New Discussion юеВ

Re: Creating a shareable image on I64

 
SOLVED
Go to solution
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

@Willem:

VERY interesting idea! I'll have a look at it.

@John:

Thanks a bunch for the confirmation. I guess the STT_SECTION/STB_LOCAL confused me, when I was looking for STT_OBJECT/STB_GLOBAL sections instead.

So for those global data symbols, the "global" attribute really is hidden in the section flags, which are only visible in the section summary.


Am appending an example object analysis file for reference.

cu,
Martin
Hoff
Honored Contributor

Re: Creating a shareable image on I64

IIRC, I posted up a symbol-export hack on Freeware V8.0, here:

http://mvb.saic.com/freeware/freewarev80/libxml2-2_6_24/

Buried in there, you'll find a DCL procedure that has all the problems mentioned earlier. Caveats are listed within the comments.

This hack might serve as a variant starting point for your needs. IIRC, what I was doing in this hack was looking at patterns in the source code.

Though what you've already got may work as well for your needs.

Having worked in this area on many occasions, access to the compiler ANA record structures and the related analysis file routines in use underneath DECset can be quite useful. I would hope these could be made semi-public by HP, akin to how the debugger record structure definitions were released. eg: http://mvb.saic.com/freeware/freewarev50/debug/

BTW, there are some decent C parsers around now, so there is another and quite different approach available; I'd probably start with the LLVM front-ends here and not with GCC.

Stephen Hoffman
HoffmanLabs LLC
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

Hoff,

I think I found it - it's the one that says "Do not use this command procedure! Ever!" and goes on to name it "a monstrous and exceedingly ugly hack", right? :-)

Despite the comments, IMHO it's a lovely idea to use LIBRARY/CROSS to locate all relocatable symbols in an object library, the data symbols being the ones with a value of 0...

Thanks for the hint!

cu,
Martin
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

Thanks for all your suggestions.

I have put aside all the hacks, and instead extended elf.c from the GNV source distribution (suggested by Michael Moroney in http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1182334 - thanks, Michael!) to give me all the DATA (i.e. global sections) and PROCEDURE global names that I need.

For reference I have appended a GNU diff file that contains the changes I made.

cu,
Martin
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

So now I learnt that you can't attach something to a closing message...

See above.
mike wagner_4
Occasional Advisor

Re: Creating a shareable image on I64

Cool, so you declare a global PSECT as DATA in a SYMBOL_VECTOR option and that works(?)!

mw
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

If you CC the sources /EXTERN=COMMON/SHARE, then yes, it seems so (don't ask me why the last porter of XMU/XAW did that - probably it has something to do with VAX C compatibility).

As this causes so much hassle, I'm thinking of changing the rules for I64...

cu,
Martin
Martin Vorlaender
Honored Contributor

Re: Creating a shareable image on I64

After removing /EXTERN=COMMON/SHARE from the XMU and XAW3D description files (because with them, I can't tell global data symbol definitions from references), and /NAMES=AS_IS from the FreeType make command files (because it was the easiest way ;-), I've now got a working copy of XPDF.

Thanks everybody! You learn something new every day.

cu,
Martin