make vmlinux .bss PROGBITS

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Tue Oct 6 19:52:15 EDT 2020


On Tue, 06 Oct 2020 13:56:11 -0500, William Tambe said:
> We have a loader that loads vmlinux.bin (created from vmlinux using
> objcopy -O binary), however if section .bss is not PROGBITS,
> vmlinux.bin does not include that space, which the loader will not
> reserve; by allocating that space in vmlinux.bin the loader also
> reserves that space.

Sounds like a buggy loader if it can't reserve a .bss segment. I mean,
how hard is that to get right?

Or are you saying that your linker is buggy, and won't output an entry
sizing the.bss unless it's got bits set, at which point your loader never
sees a .bss entry and things go pear shaped?

> To solve the problem we are looking to make section .bss PROBGITS
> using objcopy --set-section-flags .bss=alloc,load,contents , but it is
> not trivial how to modify the Linux Makefile to achieve that.

So now you have a buggy linker or loader and a custom kernel hack that you'll
have to maintain and rework every time you upgrade the kernel.

Probably more productive to figure out why you're hitting this issue when
pretty much nobody else is...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20201006/24b3de97/attachment.sig>


More information about the Kernelnewbies mailing list