Re: make vmlinux .bss PROGBITS

2020-10-06 Thread Valdis Klētnieks
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...




pgpeJdaxP1mr5.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: make vmlinux .bss PROGBITS

2020-10-06 Thread William Tambe
On Tue, Oct 6, 2020 at 1:11 PM Valdis Klētnieks  wrote:
>
> On Tue, 06 Oct 2020 08:17:44 -0500, William Tambe said:
> > How can I modify Makefile such that when vmlinux is created, following
> > command is run on vmlinux to make section .bss PROGBITS:
> > objcopy --set-section-flags .bss=alloc,load,contents
>
> Remember - vmlinux isn't going to be loaded by the userspace loader,
> but rather by a bootstrap loader.  So those flags probably don't actually
> do what you think they do.

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.
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.

>
> For that matter, what *do* you think they do, and what problem are you
> trying to solve with them?
>

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: make vmlinux .bss PROGBITS

2020-10-06 Thread Valdis Klētnieks
On Tue, 06 Oct 2020 08:17:44 -0500, William Tambe said:
> How can I modify Makefile such that when vmlinux is created, following
> command is run on vmlinux to make section .bss PROGBITS:
> objcopy --set-section-flags .bss=alloc,load,contents

Remember - vmlinux isn't going to be loaded by the userspace loader,
but rather by a bootstrap loader.  So those flags probably don't actually
do what you think they do.

For that matter, what *do* you think they do, and what problem are you
trying to solve with them?



pgpk8TabVH5kt.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


make vmlinux .bss PROGBITS

2020-10-06 Thread William Tambe
How can I modify Makefile such that when vmlinux is created, following
command is run on vmlinux to make section .bss PROGBITS:
objcopy --set-section-flags .bss=alloc,load,contents

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies