Freepascal and binary files? (Developers)
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:
- Freepascal and binary files? - Laaca, 20.05.2020, 23:15 (Developers)
- Freepascal and binary files? - RayeR, 21.05.2020, 01:46
- Freepascal and binary files? - Laaca, 21.05.2020, 10:36
- Freepascal and binary files? - Rugxulo, 21.05.2020, 02:27
- Freepascal and binary files? - marcov, 21.05.2020, 12:25
- Freepascal and binary files? - Laaca, 21.05.2020, 17:30
- Freepascal and binary files? - marcov, 22.05.2020, 13:17
- Freepascal and binary files? - Laaca, 21.05.2020, 17:30
- Freepascal and binary files? - Rugxulo, 31.05.2020, 18:50
- Freepascal and binary files? - CandyMan, 11.06.2020, 12:29
- Freepascal and binary files? - Laaca, 12.06.2020, 07:37
- Freepascal and binary files? - Laaca, 29.10.2021, 00:17
- Freepascal and binary files? - tkchia, 30.10.2021, 07:33
- Freepascal and binary files? - Laaca, 30.10.2021, 12:29
- Freepascal and binary files? - tkchia, 30.10.2021, 19:01
- Freepascal and binary files? - Rugxulo, 28.08.2022, 23:21
- Freepascal and binary files? - tkchia, 30.10.2021, 19:01
- Freepascal and binary files? - Laaca, 30.10.2021, 12:29
- Freepascal and binary files? - tkchia, 30.10.2021, 07:33
- Freepascal and binary files? - RayeR, 21.05.2020, 01:46