DJGPP + HDPMI problem: unresolved symbols (Developers)
Hi
I'm trying to compile SAMPLES\djgpp\hello.c, expecting to get stand alone executable, containing HDPMI. But I have unresolved symbols. I do the following steps:
1. gcc -c Hello.c -oHello.o
2. ld -r -x -s -T ../../lib/djgpp.ld -oHello.bin -Map hello_.map ../../lib/crt0hx.o Hello.o -lm -lc
3. ..\..\BIN\ldfix Hello.bin
4. \mingw\bin\ld -e start -o Hello.exe -Map Hello.map -pie Hello.bin
5. ..\..\BIN\pestub -q -n -w -x Hello.exe ..\..\BIN\dpmist32.bin
at step 4 I get the following errors:
Hello.bin:(.text+0x10): undefined reference to `__djgpp_ds_alias'
Hello.bin:(.text+0x2b): undefined reference to `_crt0_startup_flags'
Hello.bin:(.text+0xe2b1): undefined reference to `__djgpp_stack_top'
I found, that in original crt0.o, supplied with DJGPP, these symbols exist, but in crt0hx.o they don't. The comment in crt0hx.S says, that __djgpp_ds_alias, for example should be defined at go32\exception.S, but it isn't there.
I tried to work around the problem, by declaring the these symbols in hello.c:
---[ cut ]---
unsigned short __djgpp_ds_alias;
unsigned long __djgpp_stack_top;
int _crt0_startup_flags;
---[ cut ]---
In this case I'm able to get an executable, but when I try to run, it crashes with SIGSEGV at 004017e5.
I'm using djgpp suite ver. 2.0.4,
gcc 4.22,
g++ 4.22
Latest HXRT (2.13)
Thanks!
Complete thread:
- DJGPP + HDPMI problem: unresolved symbols - shwonder, 23.01.2008, 17:10 (Developers)
- DJGPP + HDPMI problem: unresolved symbols - Japheth, 23.01.2008, 18:34
- DJGPP + HDPMI problem: unresolved symbols - shwonder, 23.01.2008, 18:49
- DJGPP + HDPMI problem: unresolved symbols - Japheth, 23.01.2008, 19:16
- DJGPP + HDPMI problem: unresolved symbols - shwonder, 23.01.2008, 19:21
- DJGPP + HDPMI problem: unresolved symbols - Japheth, 24.01.2008, 05:27
- DJGPP + HDPMI problem: unresolved symbols - shwonder, 23.01.2008, 19:21
- DJGPP + HDPMI problem: unresolved symbols - Japheth, 23.01.2008, 19:16
- DJGPP + HDPMI problem: unresolved symbols - shwonder, 23.01.2008, 18:49
- DJGPP trouble - DOS386, 24.01.2008, 01:34
- DJGPP trouble - Japheth, 24.01.2008, 06:15
- [de]BUGging - DOS386, 19.02.2008, 02:44
- DJGPP trouble - Rugxulo, 19.02.2008, 03:28
- DJGPP trouble - Japheth, 24.01.2008, 06:15
- DJGPP + HDPMI problem: unresolved symbols - Japheth, 23.01.2008, 18:34