cobol: Update dynamic linking search paths and conventions
COBOL dynamic linking now respects CALL-CONVENTION and updates .so search policies.
This commit refactors how GCC’s COBOL runtime searches for dynamically linked shared objects (.so files). It updates the search policies to better honor the >>CALL-CONVENTION clause and ensures consistency in locating functions. Documentation and runtime logic in libgcobol.cc have been modified accordingly.
In Details
This change updates the dynamic linking behavior for GNU Cobol, primarily affecting how libgcobol searches for and resolves shared library functions. The function_pointer_from_name, __gg__function_handle_from_cobpath, and related functions now correctly honor the >>CALL-CONVENTION clause specified in Cobol source code. The search logic in find_in_dirs and do_the_dl_thing is updated to align with these new policies, ensuring that the correct function symbols are resolved from shared objects based on their calling convention.
- >>CALL-CONVENTION
- A clause in COBOL that specifies the calling convention to be used when invoking external procedures or functions, influencing how arguments are passed and returned.
- dynamic linking
- A process in which executable code is linked with libraries at run time, rather than during the compilation or build process. This allows code to be shared among multiple programs and updated independently.
- shared object
- A file containing compiled code and data that can be loaded and linked by programs at runtime. Equivalent to DLLs on Windows or .dylib on macOS. In Linux, these typically have a .so extension.