[Nasm-bugs] [Bug 3392694] [Feature request] Support ELF format segment base references

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Tue Jul 7 06:23:58 PDT 2020


https://bugzilla.nasm.us/show_bug.cgi?id=3392694

--- Comment #2 from C. Masloch <pushbx at ulukai.org> ---
This is the output of the object compiled from test7.c, showing a far call to
the assembly language function. It uses two relocations, of type R_386_16 and
R_386_OZSEG16.

$ ia16-elf-gcc test7.c -mcmodel=medium -Os -c && ia16-elf-objdump
--disassemble=main -Mi8086,intel test7.o

test7.o:     file format elf32-i386


Disassembly of section .fartext.f.test7.c.20445$:

00000000 <main>:
   0:   55                      push   bp
   1:   89 e5                   mov    bp,sp
   3:   b8 33 cc                mov    ax,0xcc33
   6:   50                      push   ax
   7:   b9 22 bb                mov    cx,0xbb22
   a:   b8 11 aa                mov    ax,0xaa11
   d:   89 c2                   mov    dx,ax
   f:   9a 00 00 00 00          call   0x0:0x0
  14:   31 c0                   xor    ax,ax
  16:   89 ec                   mov    sp,bp
  18:   5d                      pop    bp
  19:   cb                      retf   
$ ia16-elf-gcc test7.c -mcmodel=medium -Os -c && ia16-elf-objdump -x test7.o

test7.o:     file format elf32-i386
test7.o
architecture: i386, flags 0x00000011:
HAS_RELOC, HAS_SYMS
start address 0x00000000

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000000  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  00000000  00000000  00000034  2**0
                  ALLOC
  3 .fartext.f.test7.c.20445$ 0000001a  00000000  00000000  00000034  2**0
                  CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
  4 .comment      00000012  00000000  00000000  0000004e  2**0
                  CONTENTS, READONLY
SYMBOL TABLE:
00000000 l    d  .text  00000000 .text
00000000 l    d  .data  00000000 .data
00000000 l    d  .bss   00000000 .bss
00000000 l    d  .fartext.f.test7.c.20445$      00000000
.fartext.f.test7.c.20445$
00000000 l    d  .comment       00000000 .comment
00000000 g     F .fartext.f.test7.c.20445$      0000001a main
00000000         *UND*  00000000 testfunction


RELOCATION RECORDS FOR [.fartext.f.test7.c.20445$]:
OFFSET   TYPE              VALUE 
00000010 R_386_16          testfunction
00000012 R_386_OZSEG16     testfunction


$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list