summaryrefslogtreecommitdiffstats
path: root/create_debug.sh
blob: 45f4c1f497fe7b6f01bf33e0cdad133b4c68bc22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh

objdump -h memtest_shared
objdump -h boot/header.o
objdump -h boot/setup.o

BSS_SIZE=$(size -B -d memtest_shared | grep memtest_shared | tr -s ' ' | cut -d' ' -f3)
echo $BSS_SIZE
echo "bss_size: $BSS_SIZE"

ld --defsym=_bss_size=$(size -B -d memtest_shared | grep memtest_shared | tr -s ' ' | cut -d ' ' -f3) \
	-shared \
	--print-memory-usage \
	--print-output-format \
	-Bsymbolic \
	-M \
	-nostdlib \
	-T linker_modified.lds \
	-o memtest_modified.efi \
	boot/setup.o boot/startup.o boot/efisetup.o app/*.o lib/*.o system/*.o  tests/*.o

# ld -N --defsym=_bss_size=$BSS_SIZE -T linker_modified.lds boot/header.o boot/setup.o -b elf64-x86-64 memtest_shared -o memtest_modified.efi