9.42.4 Assembler Directives

as for s390 supports all of the standard ELF assembler directives as outlined in the main part of this document. Some directives have been extended and there are some additional directives, which are only available for the s390 as.

.insn

This directive permits the numeric representation of an instructions and makes the assembler insert the operands according to one of the instructions formats for ‘.insn’ (Instruction Formats). For example, the instruction ‘l %r1,24(%r15)’ could be written as ‘.insn rx,0x58000000,%r1,24(%r15)’.

.short
.long
.quad

This directive places one or more 16-bit (.short), 32-bit (.long), or 64-bit (.quad) values into the current section. If an ELF or TLS modifier is used only the following expressions are allowed: ‘symbol@modifier + constant’, ‘symbol@modifier + label + constant’, and ‘symbol@modifier - label + constant’. The following modifiers are available:

@got
@got12

The @got modifier can be used for .short, .long and .quad. The @got12 modifier is synonym to @got. The symbol is added to the GOT. The symbol term is replaced with offset from the start of the GOT to the GOT slot for the symbol.

@gotoff

The @gotoff modifier can be used for .short, .long and .quad. The symbol term is replaced with the offset from the start of the GOT to the address of the symbol.

@gotplt

The @gotplt modifier can be used for .long and .quad. A procedure linkage table entry is generated for the symbol and a jump slot for the symbol is added to the GOT. The symbol term is replaced with the offset from the start of the GOT to the jump slot for the symbol.

@plt

The @plt modifier can be used for .long and .quad. A procedure linkage table entry us generated for the symbol. The symbol term is replaced with the address of the PLT entry for the symbol.

@pltoff

The @pltoff modifier can be used for .short, .long and .quad. The symbol term is replaced with the offset from the start of the PLT to the address of the symbol.

@tlsgd
@tlsldm

The @tlsgd and @tlsldm modifier can be used for .long and .quad. A tls_index structure for the symbol is added to the GOT. The symbol term is replaced with the offset from the start of the GOT to the tls_index structure.

@gotntpoff
@indntpoff

The @gotntpoff and @indntpoff modifier can be used for .long and .quad. The symbol is added to the static TLS block and the negated offset to the symbol in the static TLS block is added to the GOT. For @gotntpoff the symbol term is replaced with the offset from the start of the GOT to the GOT slot, for @indntpoff the symbol term is replaced with the address of the GOT slot.

@dtpoff

The @dtpoff modifier can be used for .long and .quad. The symbol term is replaced with the offset of the symbol relative to the start of the TLS block it is contained in.

@ntpoff

The @ntpoff modifier can be used for .long and .quad. The symbol term is replaced with the offset of the symbol relative to the TCB pointer.

For more information about the thread local storage modifiers see the ELF extension documentation ‘ELF Handling For Thread-Local Storage’.

.ltorg

This directive causes the current contents of the literal pool to be dumped to the current location (Literal Pool Entries).

.machine STRING[+EXTENSION]…

This directive allows changing the machine for which code is generated. string may be any of the -march= selection options, or push, or pop. .machine push saves the currently selected cpu, which may be restored with .machine pop. Be aware that the cpu string has to be put into double quotes in case it contains characters not appropriate for identifiers. So you have to write "z9-109" instead of just z9-109. Extensions can be specified after the cpu name, separated by plus characters. Valid extensions are: htm, nohtm, vx, novx. They extend the basic instruction set with features from a higher cpu level, or remove support for a feature from the given cpu level.

Example: z13+nohtm allows all instructions of the z13 cpu except instructions from the HTM facility.

.machinemode string

This directive allows one to change the architecture mode for which code is being generated. string may be esa, zarch, zarch_nohighgprs, push, or pop. .machinemode zarch_nohighgprs can be used to prevent the highgprs flag from being set in the ELF header of the output file. This is useful in situations where the code is gated with a runtime check which makes sure that the code is only executed on kernels providing the highgprs feature. .machinemode push saves the currently selected mode, which may be restored with .machinemode pop.