aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-11-06 18:31:38 +1030
committerAlan Modra <amodra@gmail.com>2021-11-06 21:15:49 +1030
commite8f81980cee2d21605e60414a025f8b795147d9f (patch)
treedc8fe79916241edf32e552b5e9427a15279b81f5 /bfd
parentdd207c1302d28d2d2b33cff058bb3fbf5138b480 (diff)
downloadgdb-e8f81980cee2d21605e60414a025f8b795147d9f.zip
gdb-e8f81980cee2d21605e60414a025f8b795147d9f.tar.gz
gdb-e8f81980cee2d21605e60414a025f8b795147d9f.tar.bz2
ubsan: undefined shift in mach-o.c
This one was logically wrong too. If file_ptr was 64 bits, then -1U is extended to 0x00000000ffffffff, probably not what was intended here. * mach-o.c (FILE_ALIGN): Correct expression.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/mach-o.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index 1f0d4700..d90ea3c 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -36,7 +36,7 @@
#define bfd_mach_o_mkobject bfd_mach_o_gen_mkobject
#define FILE_ALIGN(off, algn) \
- (((off) + ((file_ptr) 1 << (algn)) - 1) & ((file_ptr) -1U << (algn)))
+ (((off) + ((ufile_ptr) 1 << (algn)) - 1) & ((ufile_ptr) -1 << (algn)))
static bool
bfd_mach_o_read_dyld_content (bfd *abfd, bfd_mach_o_dyld_info_command *cmd);