This patch fixes the TLS initial executable for AArch64. Current implementation have two issues: 1. does not generate dynamic R_AARCH64_TLS_TPREL64 relocation for the external module symbols, and 2. does not export the TLS initial executable symbol in dynamic symbol table. The fix follows the MIPS strategy to add a arch-specific GOTSection class to keep track of TLS symbols required to be place in dynamic symbol table. It also overrides the buildDynamicSymbolTable for ExecutableWrite class to add the symbols. It also adds some refactoring on AArch64RelocationPass.cpp based on ARM backend. llvm-svn: 238981
39 lines
1013 B
C++
39 lines
1013 B
C++
//===- lib/ReaderWriter/ELF/AArch64/AArch64ExecutableWriter.h -------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef AARCH64_EXECUTABLE_WRITER_H
|
|
#define AARCH64_EXECUTABLE_WRITER_H
|
|
|
|
#include "ExecutableWriter.h"
|
|
|
|
namespace lld {
|
|
namespace elf {
|
|
|
|
class AArch64TargetLayout;
|
|
class AArch64LinkingContext;
|
|
|
|
class AArch64ExecutableWriter : public ExecutableWriter<ELF64LE> {
|
|
public:
|
|
AArch64ExecutableWriter(AArch64LinkingContext &ctx,
|
|
AArch64TargetLayout &layout);
|
|
|
|
protected:
|
|
// Add any runtime files and their atoms to the output
|
|
void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
|
|
|
|
void buildDynamicSymbolTable(const File &file) override;
|
|
|
|
private:
|
|
AArch64TargetLayout &_targetLayout;
|
|
};
|
|
|
|
} // namespace elf
|
|
} // namespace lld
|
|
|
|
#endif
|