[PATCH] [lld] ELF: Support detection of relocation errors during processing

Will Newton will.newton at linaro.org
Fri Jan 2 09:21:22 PST 2015


Hi shankarke, atanasyan,

At the moment errors in relocation processing such as out of range
values are not detected or at best trapped by asserts which will not
be present in release builds. This patch adds support for checking
error return values from applyRelocation() calls and printing an
appropriate error message. It also adds support for printing multiple
errors rather than just the first one.

A test for checking the behaviour of R_AARCH64_ABS32 is added to check
the correct error message is output.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6827

Files:
  include/lld/Core/Error.h
  lib/Core/Error.cpp
  lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp
  lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h
  lib/ReaderWriter/ELF/AArch64/AArch64TargetHandler.cpp
  lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
  lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
  lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
  lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
  lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.h
  lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
  lib/ReaderWriter/ELF/PPC/PPCTargetHandler.cpp
  lib/ReaderWriter/ELF/PPC/PPCTargetHandler.h
  lib/ReaderWriter/ELF/SectionChunks.h
  lib/ReaderWriter/ELF/TargetHandler.h
  lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp
  lib/ReaderWriter/ELF/X86/X86RelocationHandler.h
  lib/ReaderWriter/ELF/X86/X86TargetHandler.cpp
  lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp
  lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
  lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp
  test/elf/AArch64/rel-abs32-overflow.test

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6827.17761.patch
Type: text/x-patch
Size: 20743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150102/918fc01f/attachment.bin>


More information about the llvm-commits mailing list