forked from OSchip/llvm-project
4597dce483
Summary: getRelocatedValue may compute incorrect value for SHT_RELA-typed relocation entries. // DWARFDataExtractor.cpp uint64_t DWARFDataExtractor::getRelocatedValue(uint32_t Size, uint32_t *Off, ... // This formula is correct for REL, but may be incorrect for RELA if the value // stored in the location (getUnsigned(Off, Size)) is not zero. return getUnsigned(Off, Size) + Rel->Value; In this patch, we * refactor these visit* functions to include a new parameter `uint64_t A`. Since these visit* functions are no longer used as visitors, rename them to resolve*. + REL: A is used as the addend. A is the value stored in the location where the relocation applies: getUnsigned(Off, Size) + RELA: The addend encoded in RelocationRef is used, e.g. getELFAddend(R) * and add another set of supports* functions to check if a given relocation type is handled. DWARFObjInMemory uses them to fail early. Reviewers: echristo, dblaikie Reviewed By: echristo Subscribers: mgorny, aprantl, aheejin, fedor.sergeev, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57939 llvm-svn: 356729 |
||
---|---|---|
.. | ||
AArch64 | ||
AMDGPU | ||
ARM | ||
Inputs | ||
Lanai | ||
Mips | ||
RISCV | ||
X86 | ||
ar-create.test | ||
ar-error.test | ||
archive-darwin-duplicates.test | ||
archive-delete.test | ||
archive-error-tmp.txt | ||
archive-extract-dir.test | ||
archive-extract.test | ||
archive-format.test | ||
archive-long-filenames-no-null-terminator.test | ||
archive-long-index.test | ||
archive-move.test | ||
archive-pad.test | ||
archive-replace-pos.test | ||
archive-symtab.test | ||
archive-thin-create.test | ||
archive-thin-paths.test | ||
archive-thin-read.test | ||
archive-toc.test | ||
archive-update.test | ||
check_binary_output.ll | ||
coff-archive-short.test | ||
coff-archive.test | ||
coff-empty-drectve.test | ||
coff-invalid.test | ||
coff-weak-externals.test | ||
corrupt.test | ||
directory.ll | ||
dllimport-globalref.ll | ||
dllimport.ll | ||
dyn-rel-relocation.test | ||
dynamic-reloc.test | ||
elf-invalid-phdr.test | ||
elf-reloc-no-sym.test | ||
elf-unknown-type.test | ||
invalid-alignment.test | ||
invalid.test | ||
kext.test | ||
lit.local.cfg | ||
macho-invalid.test | ||
mangle-ir.ll | ||
mri-addlib.test | ||
mri-addmod.test | ||
mri-crlf.test | ||
mri1.test | ||
mri2.test | ||
mri3.test | ||
mri4.test | ||
mri5.test | ||
multi-module.ll | ||
nm-archive.test | ||
nm-bitcode.test | ||
nm-darwin-m.test | ||
nm-error.test | ||
nm-irix6.test | ||
nm-pe-image.test | ||
nm-shared-object.test | ||
nm-trivial-object.test | ||
nm-universal-binary.test | ||
nm-weak-global-macho.test | ||
no-section-header-string-table.test | ||
no-section-table.test | ||
obj2yaml-coff-long-file-symbol.test | ||
obj2yaml-coff-long-section-name.test | ||
obj2yaml-coff-section-aux-symbol.test | ||
obj2yaml-coff-weak-external.test | ||
obj2yaml-invalid-reloc.test | ||
obj2yaml-sectiongroup.test | ||
obj2yaml.test | ||
objc-imageinfo-coff.ll | ||
objc-imageinfo-elf.ll | ||
objc-imageinfo-macho.ll | ||
objdump-export-list.test | ||
objdump-file-header.test | ||
objdump-no-sectionheaders.test | ||
objdump-private-headers.test | ||
objdump-reloc-shared.test | ||
objdump-relocations.test | ||
objdump-section-content.test | ||
objdump-sectionheaders.test | ||
objdump-shndx.test | ||
objdump-symbol-table.test | ||
pr25877.test | ||
readobj-absent.test | ||
readobj-elf-versioning.test | ||
readobj-shared-object.test | ||
readobj.test | ||
relocation-executable.test | ||
simple-archive.test | ||
size-trivial-macho.test | ||
stackmap-dump.test | ||
wasm-bad-metadata-version.yaml | ||
wasm-duplicate-name.test | ||
wasm-invalid-file.yaml | ||
wasm-invalid-section-order.test | ||
wasm-invalid-start.test | ||
wasm-missing-version.test | ||
wasm-relocs-and-producers.yaml | ||
wasm-string-outside-section.test | ||
yaml2obj-coff-invalid-alignment.test | ||
yaml2obj-coff-multi-doc.test | ||
yaml2obj-elf-alignment.yaml | ||
yaml2obj-elf-bits-endian.test | ||
yaml2obj-elf-file-headers-with-e_flags.yaml | ||
yaml2obj-elf-file-headers.yaml | ||
yaml2obj-elf-multi-doc.test | ||
yaml2obj-elf-rel-noref.yaml | ||
yaml2obj-elf-rel.yaml | ||
yaml2obj-elf-section-basic.yaml | ||
yaml2obj-elf-section-invalid-size.yaml | ||
yaml2obj-elf-symbol-LocalGlobalWeak.yaml | ||
yaml2obj-elf-symbol-basic.yaml | ||
yaml2obj-elf-symbol-visibility.yaml | ||
yaml2obj-invalid.yaml | ||
yaml2obj-readobj.test |