[VMS/committed]: Set extension to archive member

Tristan Gingold gingold@adacore.com
Tue Apr 17 13:34:00 GMT 2012

On Apr 17, 2012, at 2:32 PM, h.becker wrote:

> On 04/17/12 12:50, Tristan Gingold wrote:
>> VMS archives member names doesn't have extension (only the 'basename' is stored).
>> But this is not the usual convention for ar, and some tools (libtool) expect that extracted
>> members of an archive to have the standard object extension.
>> This patch implements this behaviour, thus making VMS archives more UNIX friendly.
> It's not obvious to me whether the change adds the object extension to the member name or if it is added just for extracting a member. Adding it to the member name will make the library somehow "unusal" for VMS. It may break tools like MMS and it sure will confuse VMS users. It may not break the VMS linker, but I didn't check.

It is added just when a member is extracted.  Therefore the library looks usual to the VMS linker (or to librarian).

> For what it is worth, VMS object libraries contain object modules. The name of the module is determined on VAX and Alpha: by the [e]mh$t_name in the object module header record; on I64: by the NT_VMS_MHD entry in the notes section. The object language, as documented in the Linker manual, only restricts the length of the module name: 31 characters. It is up to the tool which generates the object module - in VMS terms the language processor - to write this module header. Usually the language processors allow the users to specify the module name, for example C with "#pragma module". (The HP C compiler expects a C identifier for this #pragma, which is a HP C compiler limitation). All language processors have default values, for the case that a user doesn't specify a name. Some but not all language processors use the basename. VAX macro for example uses ".MAIN.", which is not a valid ODS2 basename. The C compiler uses the basename. For ODS5 disks this can result in funny module names for C sources like "a.b.c".

Although many VMS #pragma are now implemented in gcc, #pragma module isn't.  We currently set the module name from the basename of the file.


More information about the Binutils mailing list