summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/DataExtractor.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-24 05:37:20 +0000
committerFangrui Song <maskray@google.com>2019-06-24 05:37:20 +0000
commit2fb6b0f2baf4b1da6201035f53ca7e471b9d4c1e (patch)
tree3b6cae64b81f22f31ef796bb68d4e07914cdc72a /llvm/lib/Support/DataExtractor.cpp
parente8da65c698edf099208fa041d956490cf25e70a3 (diff)
downloadbcm5719-llvm-2fb6b0f2baf4b1da6201035f53ca7e471b9d4c1e.tar.gz
bcm5719-llvm-2fb6b0f2baf4b1da6201035f53ca7e471b9d4c1e.zip
[ELF][PPC][X86] Use [-2**(n-1), 2**n) to check overflows for R_PPC_ADDR16, R_PPC64_ADDR{16,32}, R_X86_64_{8,16}
Similar to R_AARCH64_ABS32, R_PPC64_ADDR32 can represent either a signed value or unsigned value, thus we should use `[-2**(n-1), 2**n)` instead of `[-2**(n-1), 2**(n-1))` to check overflows. The issue manifests as a bogus linker error when linking the powerpc64le Linux kernel. The new behavior is compatible with ld.bfd's complain_overflow_bitfield. The upper bound of the error message is not correct. Fix it as well. The changes to R_PPC_ADDR16, R_PPC64_ADDR16, R_X86_64_8 and R_X86_64_16 are similar. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D63690 llvm-svn: 364164
Diffstat (limited to 'llvm/lib/Support/DataExtractor.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud