Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace AIX
Created by Guest
Created on Sep 14, 2017

AIX GL glue linkage assembler for custom dynamic linkage code.

This enhancement is specific to AIX and is a problem with the linker/binder software ('ld') and relates to the use of the GL storage mapping class within assembler files.

Micro Focus Visual COBOL uses some dynamically created assembler files in order to resolve an address at runtime the code for which does not exist when the calling code is compiled.

The mechanism we use to resolve this has been in use for over a decade but fails with recent linkers.

This RFE requests that previous behaviour is re-instated (use of [GL] storage mapping class in end-user provided assembler is allowed by the linker/binder) or perhaps that an alternative compatibile mechanism be provided.

It is important to note that the target callee code may not be native code, thus the resolved address might be an interpreter, or a custom loader, or native code such as is present in the demo.

The remainder of this description describes the mechanism by which a call is resolved at build time and at run-time.

The call proceeds as follows.

Something in the main program, (caller.c : main() in the demo) calls something, ('callee()' in the demo).
The actual target wanted is not and cannot be known at build time, thus the target code is not linked in at this time.

This call is resolved at build time to either 'xldyn_callee.s' (statically) or 'preload_callee.s' built into a linked shared object. In the real system
these assembler files are created 'on the fly'.

At runtime, these call into our runtime system (in the demo to 'caller.c : the_dynload()') which gets some address we really want to go to, whether an interpreter or direct native code or whatever.

The address is returned to the assembler and xldyn_callee.s or preload_callee.s (they are very similar) then branch to that address.

Thus if the final target is debugged (callee.c : callee() ) it sees the main 'caller' (main() within caller.c in the demo) as its immediate caller. There is nothing between them on the call stack.

Note that is is not possible (as has been suggested) to use a dynamic object (ld -brtl) to resolve the initial call to 'callee' because the end-user is expecting a single executable to be produced, not multiple files.

The xldyn_callee.s and preload_callee.s assembler files use '[GL]' glue linkage to reach the runtime (the_dynload in the demo) to get the wanted address to branch to. They are not '[PR]' and the mechanism does not work if the storage mapping class is changed to PR.

The demo created 3 executables (older versions of this demo had 4, but one is superfluous).

- callerLD - The problematical executable - linked (statically) with xldyn_callee.s AND preload_callee.s (in libprestub.so). This crashes (SEGV or Illegal instruction) if built with a later linker. I have version ld: LD 1.65.6.6 (4/1/14), though I believe there is more to this that just the linker version.

- callerX - statically linked only with xldyn_callee.s - works every time, thus demonstrating that 'xldyn_callee.s' works.

- callerP - linked with libprestub.so which contains 'preload_callee.s', also works, thus preload_callee.s works.

If callerLD is debugged on a failing system and single stepped it can be seen calling 'callee()' from 'main()' and executing some glue code injected by the linker which then jumps off to a junk location and fails - without ever hitting any more of the demo code.

The linker at no point warns of invalid code when the executable is built. If there is a problem, it should give a warning.

The linker behaves differently when only one of the 2 assembler files is linked (it works in those cases).

Idea priority Medium
  • Guest
    Reply
    |
    Sep 25, 2019

    IBM has evaluated the priority of this enhancement proposal relative to other future product content and determined that this RFE will not be pursued for a future product release.

  • Guest
    Reply
    |
    Sep 14, 2017

    Attachment (Description): The demo for the problem the enhancement should fix - note on older linkers this just works. Extract the tar file ('tar xf GL_trouble.tar') cd into 'GL_trouble' and run 'runtest.sh' which will build and run the demo.