1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00
llvm-mirror/tools
David Blaikie d3ee11b29a llvm-objcopy: fix section size truncation/extension when dumping sections
Since this only comes up with inputs containing sections at least 4GB
large (I guess I could use a bzero section or something, so the input
file doesn't have to be 4GB, but even then the output file would have to
be 4GB, right?) I've skipped testing this. If there's a nice way to test
this without needing 4GB inputs or output files.

The subtlety here is demonstrated by this code:

struct t { operator uint64_t(); };
static_assert(std::is_same_v<int, decltype(std::declval<bool>() ? 0 : std::declval<t>())>);
static_assert(std::is_same_v<uint64_t, decltype(std::declval<bool>() ? 0 : std::declval<uint64_t>())>);

Because of this difference, the original source code was getting an int
type (truncating the actual size) and then extending it again, resulting
in bogus values (I haven't thought through this hard enough to explain
why the resulting value was 0xffff... - sign extension, possible UB, but
in any case it's the wrong answer - in this particular case I was
looking at that resulted in a size so large that we couldn't open a file
large enough to write to and ended up with a rather vague:

error: 'file_name.o': Invalid argument
2021-06-12 19:00:10 -07:00
..
bugpoint
bugpoint-passes
dsymutil
gold
llc
lli
llvm-ar
llvm-as
llvm-as-fuzzer
llvm-bcanalyzer
llvm-c-test
llvm-cat
llvm-cfi-verify
llvm-config
llvm-cov
llvm-cvtres
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
llvm-diff
llvm-dis
llvm-dwarfdump
llvm-dwp
llvm-elfabi
llvm-exegesis [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
llvm-extract
llvm-go
llvm-gsymutil
llvm-ifs
llvm-isel-fuzzer
llvm-itanium-demangle-fuzzer
llvm-jitlink
llvm-jitlistener
llvm-libtool-darwin
llvm-link
llvm-lipo
llvm-lto [LTO] Support new PM in ThinLTOCodeGenerator. 2021-06-09 10:05:14 +01:00
llvm-lto2
llvm-mc
llvm-mc-assemble-fuzzer
llvm-mc-disassemble-fuzzer
llvm-mca
llvm-microsoft-demangle-fuzzer
llvm-ml [ms] [llvm-ml] Add support for INCLUDE environment variable 2021-06-09 17:54:40 -04:00
llvm-modextract
llvm-mt
llvm-nm
llvm-objcopy llvm-objcopy: fix section size truncation/extension when dumping sections 2021-06-12 19:00:10 -07:00
llvm-objdump
llvm-opt-fuzzer
llvm-opt-report
llvm-pdbutil [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
llvm-profdata
llvm-profgen
llvm-rc
llvm-readobj Reland "[AMDGPU] Add gfx1013 target" 2021-06-08 21:15:35 -04:00
llvm-reduce
llvm-rtdyld
llvm-rust-demangle-fuzzer Fix implicit dependency on <string> header. NFCI. 2021-06-11 10:24:14 +01:00
llvm-shlib
llvm-size
llvm-special-case-list-fuzzer
llvm-split
llvm-stress [llvm-stress] Fix dead code preventing us generating per-element vector selects 2021-06-11 10:56:19 +01:00
llvm-strings
llvm-symbolizer
llvm-tapi-diff Reland "[llvm] llvm-tapi-diff" 2021-06-09 21:17:34 -07:00
llvm-undname
llvm-xray
llvm-yaml-numeric-parser-fuzzer
llvm-yaml-parser-fuzzer
lto [AIX] Build libLTO as MODULE rather than SHARED 2021-06-10 12:08:59 -04:00
msbuild
obj2yaml
opt
opt-viewer
remarks-shlib
sancov
sanstats
split-file
verify-uselistorder
vfabi-demangle-fuzzer
xcode-toolchain
yaml2obj
CMakeLists.txt