ELF option
This is a Linux® only option. It is provided to allow creation of ELF files directly. It may also be specified in the form ELF32 or ELF64 to select the ELF format required. If it is specified as ELF, the format is set to ELF64 if the first section uses RMODE 64, and ELF32 otherwise.
If the ELF, ELF32, or ELF64 option is specified, changes are made to the options passed the assembler to invoke the exit.
ELF files may also be created directly with HLASM on any supported operating system (including Linux) by specifying the object exit ASMAXT2E option with appropriate parameters:
EX(OBX(ASMAXT2E)) for ELF
EX(OBX(ASMAXT2E(32))) for ELF32
EX(OBX(ASMAXT2E(64))) for ELF64
An additional option letter "R" may be used to indicate that all control sections are to be treated as read-only, as if they were defined using RSECT, for example:
EX(OBX(ASMAXT2E(R64))) for ELF64 with read-only CSECTs
- All section lengths are rounded up to a doubleword.
- ELF32 name lengths are set to the section length for SD, CM, and PC items, and to 4 for LD items. The name of the section is not affected.
- Zero-length sections are assigned length 8.
- RSects are assigned to ELF32 section
'.text'
, and are assigned the executable attribute. - CSects are assigned to ELF32 section
'.data'
, and are assigned the writable and executable attributes. - Common sections are supported. The linker maps common to the
'.bss'
uninitialised storage section unless a CSect with the same name is found, in which case that section is used instead. Unnamed common is renamed to'BLANK.CM'
. - High Level Assembler converts object files or GOFF files to ELF format.
- When generating ELF32 object files, the following limitations apply:
- A minimum of 25 KB working storage must be available.
- The GOFF option may be specified. It is required if any external names may exceed 8 characters or a SECTALGN value exceeding 8 bytes is to be used. It should also be specified if external relative immediate addresses or the option SECTALGN(16) are used, in order to avoid warning messages about possible NOGOFF limitations.
- Do not specify external names starting with an underscore (
_
), as they may conflict with Linux-generated names during the linking and loading process. - Entry points (LD items) must not be specified in common sections.
- Q-type and CXD-type address constants are not supported.
- External dummy sections (DXD items, and dummy control sections referenced in Q-type address constants) are not supported.
- Address constants of lengths other than 4 for ELF32 and 4 or 8 for ELF64 are not supported. 4-byte address constants for ELF64 will not give valid results if the target address does not fit within 4 bytes.
- Only AMODE(31) and RMODE(ANY) are supported for ELF32, and only AMODE(64) and RMODE(64) for ELF64. If neither AMODE nor RMODE is specified and the ELF32 or ELF64 option is specified, an omitted AMODE or RMODE option is accepted as if it were the supported value.
- Internal tables used during the conversion process are automatically reallocated at a larger size if necessary. The size and complexity of the program to be converted is only limited by the available amount of working storage.
- Double relocations, although correctly converted, do not work. The Linux
ld
command does not add the previous contents of an adcon field when performing relocations. - Zero-length Private Code (PC) sections are ignored.
- Negative relocations (for example,
A(0-*)
) are not supported.