While attempting to work on implementing readdir in ISOLINUX, I made
it large enough that it overflowed for isolinux-debug.
$ make all
nasm -O9999 -f elf -g -F stabs
-DDATE_STR="'pre11-112-g930881b*'" \
-DHEXDATE="0x49caaf5b" \
-l isolinux.lsr -o isolinux.o isolinux.asm
ld -m elf_i386 -T syslinux.ld -M -o isolinux.elf isolinux.o > isolinux.map
objdump -h isolinux.elf > isolinux.sec
perl lstadjust.pl isolinux.lsr isolinux.sec isolinux.lst
objcopy -O binary isolinux.elf isolinux.bin
perl checksumiso.pl isolinux.bin
nasm -O9999 -f elf -g -F stabs
-DDATE_STR="'pre11-112-g930881b*'" \
-DHEXDATE="0x49caaf5b" \
-l isolinux-debug.lsr -o isolinux-debug.o isolinux-debug.asm
ld -m elf_i386 -T syslinux.ld -M -o isolinux-debug.elf
isolinux-debug.o > isolinux-debug.map
ld: 64K overflow
ld: 64K overflow
isolinux-debug.o: In function `msg_filename':
isolinux-debug.asm:(.text+0x202d): relocation truncated to fit:
R_386_16 against `.bss1'
isolinux-debug.o: In function `msg_viewimage':
isolinux-debug.asm:(.text+0x2049): relocation truncated to fit:
R_386_16 against `.bss1'
ld: 64K overflow
make: *** [isolinux-debug.elf] Error 1
Examining isolinux-debug.map, .bss1 seems to be ending just above the
64kiB mark, mostly because .adv gets incremented up (0xB200 to
0xB400).
Am I correct in assuming that it would either require reworking the
layout or adding another true segment to be able to handle this?
Doing another true segment would probably require storing a handle in
a .bss type section and initializing early. A quick idea on the
layout might be moving .adv to the top but unfortunately I don't
understand enough about the thoughts surrounding the layout.
Gene Cumm wrote:> > Examining isolinux-debug.map, .bss1 seems to be ending just above the > 64kiB mark, mostly because .adv gets incremented up (0xB200 to > 0xB400). > > Am I correct in assuming that it would either require reworking the > layout or adding another true segment to be able to handle this? > Doing another true segment would probably require storing a handle in > a .bss type section and initializing early. A quick idea on the > layout might be moving .adv to the top but unfortunately I don't > understand enough about the thoughts surrounding the layout. >Something like that... rebalancing the various .bss segments might be an option. I'm considering doing something off-segment for rarely used data; in particular the font buffer is 8K in size which is a lot for segment zero. Furthermore, the ADV probably has to expand to 2x4K at some point (because disk drive manufacturers are itching at changing to 4K sectors on disk) so it may need to move anyway. The concern,of course, is that intersegment access is always painful and error prone, and pushing the upper limit of the low memory area may cause failures, especially for PXELINUX. Now, to be fair, I have reduced the low memory footprint *a lot*, so perhaps it's not such a big deal; on the other hand, perhaps we can get away with a smaller cache. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.