Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lesson04] Raspberry Pi 4 Model B Make error #217

Open
jeremypbrien opened this issue Nov 29, 2020 · 4 comments
Open

[Lesson04] Raspberry Pi 4 Model B Make error #217

jeremypbrien opened this issue Nov 29, 2020 · 4 comments

Comments

@jeremypbrien
Copy link

After changing the PBASE to 0xFE000000 for the raspberry pi 4 model B, I get the following error when running make:

build/boot_s.o: in function 'el1_entry':
(.text.boot+0x44): relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against symbol 'bss_end' defined in .bss section in build/kernel8.elf
make: *** [Makefile:30: kernel8.img] Error 1

Lessons 1-3 work, but all other lessons are getting this error. Is there a workaround to make these lessons work for the raspberry pi 4 model B?

@rockytriton
Copy link

Try changing this line:
https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson04/src/boot.S#L41
It should be:
mov sp, #LOW_MEMORY

Not sure why lesson04 changed it since lesson05 still has it using #LOW_MEMORY

@maxstreitberger
Copy link

I got the same error, and I don't know what I should do. I already tried to add #LOW_MEMORY, but that doesn't change anything. It could be because #LOW_MEMORY is the same as #(2 * SECTION_SIZE).

@rhythm16
Copy link

Hi, I got the same error, and found that in my case the line static unsigned short mem_map [ PAGING_PAGES ] = {0,}; in mm.c causes the bss section to be too large, exceeding the pc-relative addressing limit in the line adr x1, bss_end in boot.S. I changed mem_map's type to uint8_t and it compiled successfully. Caution this may not be the exact cause of your compilation error because I have set my LOW_MEMORY and HIGH_MEMORY differently (0x40000000 to 0xFC000000).

@cuijier
Copy link

cuijier commented Jun 9, 2022

About this problem,we can use size cmd to check build/*.o file .bss section whether size is normal. for my problem, i foundmm_c.o .bss section size is too big , which means uninit var is too big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants