Message ID | 20210325155657.600897-2-drjones@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | arm64: One fix and one improvement | expand |
On 25/03/2021 15:56, Andrew Jones wrote: > If argc isn't aligned to eight bytes then loading it as if it's > eight bytes wide is a bad idea. It's only four bytes wide, so we > should only load four bytes. > > Reported-by: Nikos Nikoleris <nikos.nikoleris@arm.com> > Signed-off-by: Andrew Jones <drjones@redhat.com> Thanks for fixing this. Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> > --- > arm/cstart64.S | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arm/cstart64.S b/arm/cstart64.S > index 89321dad7aba..0a85338bcdae 100644 > --- a/arm/cstart64.S > +++ b/arm/cstart64.S > @@ -100,7 +100,7 @@ start: > 1: > /* run the test */ > adrp x0, __argc > - ldr x0, [x0, :lo12:__argc] > + ldr w0, [x0, :lo12:__argc] > adrp x1, __argv > add x1, x1, :lo12:__argv > adrp x2, __environ >
diff --git a/arm/cstart64.S b/arm/cstart64.S index 89321dad7aba..0a85338bcdae 100644 --- a/arm/cstart64.S +++ b/arm/cstart64.S @@ -100,7 +100,7 @@ start: 1: /* run the test */ adrp x0, __argc - ldr x0, [x0, :lo12:__argc] + ldr w0, [x0, :lo12:__argc] adrp x1, __argv add x1, x1, :lo12:__argv adrp x2, __environ
If argc isn't aligned to eight bytes then loading it as if it's eight bytes wide is a bad idea. It's only four bytes wide, so we should only load four bytes. Reported-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Signed-off-by: Andrew Jones <drjones@redhat.com> --- arm/cstart64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)