From a148a448ec071faaf0af4d5eaad6178eded35477 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 31 Aug 2020 10:03:59 +0930 Subject: [PATCH] PR26457 UBSAN: som.c:1794 left shift cannot be represented PR 26457 * som/aout.h (SOM_SUBSPACE_ACCESS_CONTROL_BITS_MASK): Make unsigned. (SOM_SUBSPACE_MEMORY_RESIDENT, SOM_SUBSPACE_DUP_COMMON) (SOM_SUBSPACE_IS_COMMON, SOM_SUBSPACE_IS_LOADABLE) (SOM_SUBSPACE_QUADRANT_MASK, SOM_SUBSPACE_INITIALLY_FROZEN) (SOM_SUBSPACE_IS_FIRST, SOM_SUBSPACE_CODE_ONLY) (SOM_SUBSPACE_SORT_KEY_MASK, SOM_SUBSPACE_REPLICATE_INIT) (SOM_SUBSPACE_CONTINUATION, SOM_SUBSPACE_IS_TSPECIFIC) (SOM_SUBSPACE_IS_COMDAT): Likewise. --- include/ChangeLog | 12 ++++++++++++ include/som/aout.h | 28 ++++++++++++++-------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/include/ChangeLog b/include/ChangeLog index 4da03f8cd9b..c76d9cc8976 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,15 @@ +2020-08-31 Alan Modra + + PR 26457 + * som/aout.h (SOM_SUBSPACE_ACCESS_CONTROL_BITS_MASK): Make unsigned. + (SOM_SUBSPACE_MEMORY_RESIDENT, SOM_SUBSPACE_DUP_COMMON) + (SOM_SUBSPACE_IS_COMMON, SOM_SUBSPACE_IS_LOADABLE) + (SOM_SUBSPACE_QUADRANT_MASK, SOM_SUBSPACE_INITIALLY_FROZEN) + (SOM_SUBSPACE_IS_FIRST, SOM_SUBSPACE_CODE_ONLY) + (SOM_SUBSPACE_SORT_KEY_MASK, SOM_SUBSPACE_REPLICATE_INIT) + (SOM_SUBSPACE_CONTINUATION, SOM_SUBSPACE_IS_TSPECIFIC) + (SOM_SUBSPACE_IS_COMDAT): Likewise. + 2020-08-28 Cooper Qu * elf/csky.h (SHT_CSKY_ATTRIBUTES): Define. diff --git a/include/som/aout.h b/include/som/aout.h index 01b301fe01c..e3675cced7e 100644 --- a/include/som/aout.h +++ b/include/som/aout.h @@ -157,22 +157,22 @@ struct som_external_subspace_dictionary_record }; #define SOM_SUBSPACE_ACCESS_CONTROL_BITS_SH 25 -#define SOM_SUBSPACE_ACCESS_CONTROL_BITS_MASK 0x7f -#define SOM_SUBSPACE_MEMORY_RESIDENT (1 << 24) -#define SOM_SUBSPACE_DUP_COMMON (1 << 23) -#define SOM_SUBSPACE_IS_COMMON (1 << 22) -#define SOM_SUBSPACE_IS_LOADABLE (1 << 21) +#define SOM_SUBSPACE_ACCESS_CONTROL_BITS_MASK 0x7fU +#define SOM_SUBSPACE_MEMORY_RESIDENT (1U << 24) +#define SOM_SUBSPACE_DUP_COMMON (1U << 23) +#define SOM_SUBSPACE_IS_COMMON (1U << 22) +#define SOM_SUBSPACE_IS_LOADABLE (1U << 21) #define SOM_SUBSPACE_QUADRANT_SH 19 -#define SOM_SUBSPACE_QUADRANT_MASK 0x3 -#define SOM_SUBSPACE_INITIALLY_FROZEN (1 << 18) -#define SOM_SUBSPACE_IS_FIRST (1 << 17) -#define SOM_SUBSPACE_CODE_ONLY (1 << 16) +#define SOM_SUBSPACE_QUADRANT_MASK 0x3U +#define SOM_SUBSPACE_INITIALLY_FROZEN (1U << 18) +#define SOM_SUBSPACE_IS_FIRST (1U << 17) +#define SOM_SUBSPACE_CODE_ONLY (1U << 16) #define SOM_SUBSPACE_SORT_KEY_SH 8 -#define SOM_SUBSPACE_SORT_KEY_MASK 0xff -#define SOM_SUBSPACE_REPLICATE_INIT (1 << 7) -#define SOM_SUBSPACE_CONTINUATION (1 << 6) -#define SOM_SUBSPACE_IS_TSPECIFIC (1 << 5) -#define SOM_SUBSPACE_IS_COMDAT (1 << 4) +#define SOM_SUBSPACE_SORT_KEY_MASK 0xffU +#define SOM_SUBSPACE_REPLICATE_INIT (1U << 7) +#define SOM_SUBSPACE_CONTINUATION (1U << 6) +#define SOM_SUBSPACE_IS_TSPECIFIC (1U << 5) +#define SOM_SUBSPACE_IS_COMDAT (1U << 4) struct som_external_compilation_unit { -- 2.30.2