mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 23:51:56 +00:00
c94d393ad5
This linker backend is still a work in progress but is enough to link simple programs including linking against library archives. Differential Revision: https://reviews.llvm.org/D34851 llvm-svn: 318539
26 lines
826 B
C++
26 lines
826 B
C++
//===- InputSegment.cpp ---------------------------------------------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "InputSegment.h"
|
|
#include "OutputSegment.h"
|
|
#include "lld/Common/LLVM.h"
|
|
|
|
#define DEBUG_TYPE "lld"
|
|
|
|
using namespace llvm;
|
|
using namespace lld::wasm;
|
|
|
|
uint32_t InputSegment::translateVA(uint32_t Address) const {
|
|
assert(Address >= startVA() && Address < endVA());
|
|
int32_t Delta = OutputSeg->StartVA + OutputSegmentOffset - startVA();
|
|
DEBUG(dbgs() << "translateVA: " << getName() << " Delta=" << Delta
|
|
<< " Address=" << Address << "\n");
|
|
return Address + Delta;
|
|
}
|