lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH v2 2/2] objtool: fix x86 orc generation on big endian cross compiles
Date
From: Vasily Gorbik
> Sent: 30 September 2020 13:24
>
> Correct objtool orc generation endianness problems to enable fully
> functional x86 cross compiles on big endian hardware.
>
...
> +
> +#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
> +
> struct orc_entry {
> s16 sp_offset;
> s16 bp_offset;
> @@ -57,6 +67,20 @@ struct orc_entry {
> unsigned end:1;
> } __packed;
>
> +#else
> +
> +struct orc_entry {
> + s16 sp_offset;
> + s16 bp_offset;
> + unsigned bp_reg:4;
> + unsigned sp_reg:4;
> + unsigned unused:5;
> + unsigned end:1;
> + unsigned type:2;
> +} __packed;
> +
> +#endif

Shouldn't that be checking BITFIELD_ENDIAN.

I also think that (in the other patch) you can assume
that you don't need to byteswap if __KERNEL__ is defined.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2020-09-30 15:07    [W:0.048 / U:15.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site