Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Freepascal and binary files? (Developers)

posted by tkchia Homepage, 30.10.2021, 19:01

Hello Laaca,

> And maybe the FPC internal linker is such valid but too simplistic object
> file like above mentioned HELLO.O

OK, I did a quick test with my MinGW32 ld which I happen to have installed on my Ubuntu box:

$ echo hello >hello.txt
$ x86_64-w64-mingw32-ld -r -b binary hello.txt -o hello.o
$ x86_64-w64-mingw32-objdump -x hello.o
...
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .data         00000010  0000000000000000  0000000000000000  00000064  2**4
                  CONTENTS, ALLOC, LOAD, DATA
  1 .rdata        00000000  0000000000000000  0000000000000000  00000000  2**4
                  ALLOC, LOAD, READONLY, DATA
SYMBOL TABLE:
[  0](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000000 _binary_hello_txt_start
[  1](sec -1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000006 _binary_hello_txt_size
[  2](sec  1)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000006 _binary_hello_txt_end


(The target platform is not the same as DJGPP COFF, but it is COFF and probably close enough for this quick and dirty test...)

The section index for the symbol _binary_hello_txt_size is -1. I guess -1 is used for absolute values that do not belong to any section.

My guess is that something similar was happening with your hello.o — and Free Pascal was complaining because it did not like the -1 section number.

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 265 users online (1 registered, 264 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum