Quoting a post of a ipxe related developer that did a nice check realizing that e.g. disassembly always lists pushq (and opcode stays the same) - thanks to Valentine for these checks!:
AFAIU, segment registers
are 16-bit long, however, "pushl" and "pushq" should also be valid and
produce the same opcode.
Quite interesting that obdump -S always shows "pushq" even when
"push" or "pushl" is used in the original source.
Quoting a post of a ipxe related developer that did a nice check realizing that e.g. disassembly always lists pushq (and opcode stays the same) - thanks to Valentine for these checks!:
AFAIU, segment registers
are 16-bit long, however, "pushl" and "pushq" should also be valid and
produce the same opcode.
Quite interesting that obdump -S always shows "pushq" even when
"push" or "pushl" is used in the original source.
Please, take a look at the following log:
<email address hidden>:/tmp$ cat push.S
push %gs
push %fs
<email address hidden>:/tmp$ as --64 push.S -o push.out
<email address hidden>:/tmp$ objdump -S push.out
push.out: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <.text>:
0: 0f a8 pushq %gs
2: 0f a0 pushq %fs
<email address hidden>:/tmp$ cat pushl.S
pushl %gs
pushl %fs
<email address hidden>:/tmp$ as --64 pushl.S -o pushl.out
<email address hidden>:/tmp$ objdump -S pushl.out
pushl.out: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <.text>:
0: 0f a8 pushq %gs
2: 0f a0 pushq %fs
<email address hidden>:/tmp$ cat pushq.S
pushq %gs
pushq %fs
<email address hidden>:/tmp$ as --64 pushq.S -o pushq.out
pushq.S: Assembler messages:
pushq.S:1: Error: operand type mismatch for `push'
pushq.S:2: Error: operand type mismatch for `push'