llvm-project/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h
Adhemerval Zanella 4bcc13d988 [ELF/AArch64] Fix correct TCB aligment calculation
This patch fixes the TLS local relocations alignment done by @238258.
As pointed out, the TLS size should not be considered, but rather the
TCB size based on maximum output segment alignment.  Although it has
not shown in the TLS simple cases for test-suite, more comprehensible
tests with more local TLS variable showed wrong relocations values
being generated.

The local TLS testcase is expanded to add more tls variable (both
exported and static) initialized or not.

llvm-svn: 238960
2015-06-03 20:39:30 +00:00

37 lines
1022 B
C++

//===- lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h ------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef AARCH64_RELOCATION_HANDLER_H
#define AARCH64_RELOCATION_HANDLER_H
#include "lld/ReaderWriter/ELFLinkingContext.h"
namespace lld {
namespace elf {
class AArch64TargetLayout;
class AArch64TargetRelocationHandler final : public TargetRelocationHandler {
public:
AArch64TargetRelocationHandler(AArch64TargetLayout &layout)
: _layout(layout) {}
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
const AtomLayout &,
const Reference &) const override;
private:
AArch64TargetLayout &_layout;
};
} // end namespace elf
} // end namespace lld
#endif // AArch64_RELOCATION_HANDLER_H