+2020-09-01 Alan Modra <amodra@gmail.com>
+
+ * reloc.c (N_ONES): Handle N=0.
+ * elf32-arm.c (elf32_arm_howto_table_1): Set complain_overflow_dont
+ for R_ARM_TLS_DESCSEQ and R_ARM_THM_TLS_DESCSEQ.
+
2020-09-01 Alan Modra <amodra@gmail.com>
PR 26429
0, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
+ complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_DESCSEQ", /* name */
FALSE, /* partial_inplace */
0, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
+ complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_THM_TLS_DESCSEQ",/* name */
FALSE, /* partial_inplace */
.
*/
-/* N_ONES produces N one bits, without overflowing machine arithmetic. */
-#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
+/* N_ONES produces N one bits, without undefined behaviour for N
+ between zero and the number of bits in a bfd_vma. */
+#define N_ONES(n) ((n) == 0 ? 0 : ((bfd_vma) 1 << ((n) - 1) << 1) - 1)
/*
FUNCTION