bloaty/bloaty-1.1-longlong.patch
Rich Mattes f945916f43 Fix build and add 32bit compat patch.
Fix the cmake macros to work with the new cmake changes.

Add a patch to correct the handling of file sizes with 32 bit size_t on
32 bit architectures.
2020-08-02 17:41:59 -04:00

19 lines
720 B
Diff

diff -up ./src/elf.cc.2 ./src/elf.cc
--- ./src/elf.cc.2 2020-08-02 17:34:06.872636546 -0400
+++ ./src/elf.cc 2020-08-02 17:34:26.293491457 -0400
@@ -794,12 +794,12 @@ void ForEachElf(const InputFile& file, R
//
// - 24 bits for index (up to 16M symbols with -ffunction-sections)
// - 40 bits for address (up to 1TB section)
-static uint64_t ToVMAddr(size_t addr, long ndx, bool is_object) {
+static uint64_t ToVMAddr(uint64_t addr, int64_t ndx, bool is_object) {
if (is_object) {
if (ndx >= 1 << 24) {
THROW("ndx overflow: too many sections");
}
- if (addr >= 1UL << 40) {
+ if (addr >= 1ULL << 40) {
THROW("address overflow: section too big");
}
return (ndx << 40) | addr;