From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: ubsan: som: left shift of 1 by 31 places
Date: Tue, 10 Mar 2020 22:03:50 +1030 [thread overview]
Message-ID: <20200310113350.GU5384@bubble.grove.modra.org> (raw)
* som/aout.h (SOM_AUX_ID_MANDATORY, SOM_SPACE_IS_LOADABLE),
(SOM_SYMBOL_HIDDEN, SOM_SYMBOL_HAS_LONG_RETURN): Use 1u << 31.
* som/lst.h (LST_SYMBOL_HIDDEN): Likewise.
diff --git a/include/som/aout.h b/include/som/aout.h
index 618f09dcc9..01b301fe01 100644
--- a/include/som/aout.h
+++ b/include/som/aout.h
@@ -86,7 +86,7 @@ struct som_external_aux_id
#define COPYRIGHT_AUX_ID 9
/* Aux id flags. */
-#define SOM_AUX_ID_MANDATORY (1 << 31)
+#define SOM_AUX_ID_MANDATORY (1u << 31)
#define SOM_AUX_ID_COPY (1 << 30)
#define SOM_AUX_ID_APPEND (1 << 29)
#define SOM_AUX_ID_IGNORE (1 << 28)
@@ -134,7 +134,7 @@ struct som_external_space_dictionary_record
unsigned char init_pointer_quantity[4];
};
-#define SOM_SPACE_IS_LOADABLE (1 << 31)
+#define SOM_SPACE_IS_LOADABLE (1u << 31)
#define SOM_SPACE_IS_DEFINED (1 << 30)
#define SOM_SPACE_IS_PRIVATE (1 << 29)
#define SOM_SPACE_HAS_INTERMEDIATE_CODE (1 << 28)
@@ -195,7 +195,7 @@ struct som_external_symbol_dictionary_record
};
/* Flags fields. */
-#define SOM_SYMBOL_HIDDEN (1 << 31)
+#define SOM_SYMBOL_HIDDEN (1u << 31)
#define SOM_SYMBOL_SECONDARY_DEF (1 << 30)
#define SOM_SYMBOL_TYPE_SH 24
#define SOM_SYMBOL_TYPE_MASK 0x3f
@@ -214,7 +214,7 @@ struct som_external_symbol_dictionary_record
#define SOM_SYMBOL_ARG_RELOC_MASK 0x3ff
/* Info fields. */
-#define SOM_SYMBOL_HAS_LONG_RETURN (1 << 31)
+#define SOM_SYMBOL_HAS_LONG_RETURN (1u << 31)
#define SOM_SYMBOL_NO_RELOCATION (1 << 30)
#define SOM_SYMBOL_IS_COMDAT (1 << 29)
#define SOM_SYMBOL_SYMBOL_INFO_SH 0
diff --git a/include/som/lst.h b/include/som/lst.h
index f97237ffe9..014fc7a89a 100644
--- a/include/som/lst.h
+++ b/include/som/lst.h
@@ -69,7 +69,7 @@ struct som_external_lst_symbol_record
};
/* Fields of flags. */
-#define LST_SYMBOL_HIDDEN (1 << 31)
+#define LST_SYMBOL_HIDDEN (1u << 31)
#define LST_SYMBOL_SECONDARY_DEF (1 << 30)
#define LST_SYMBOL_SYMBOL_TYPE_SH 24
#define LST_SYMBOL_SYMBOL_SCOPE_SH 20
--
Alan Modra
Australia Development Lab, IBM
reply other threads:[~2020-03-10 11:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200310113350.GU5384@bubble.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).