Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions lld/ELF/Arch/AIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class AIE final : public TargetInfo {
uint32_t calcEFlags() const override;
RelExpr getRelExpr(RelType Type, const Symbol &S,
const uint8_t *Loc) const override;
void relocate(uint8_t *Loc, const Relocation &rel, uint64_t Val) const override;
void relocate(uint8_t *Loc, const Relocation &rel,
uint64_t Val) const override;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about lld coding style, but I would say that rel should be Rel.


private:
void relocateAIE1(uint8_t *Loc, const Relocation &rel, uint64_t Val) const;
Expand Down Expand Up @@ -70,7 +71,7 @@ uint32_t AIE::calcEFlags() const {
}

RelExpr AIE::getRelExpr(const RelType Type, const Symbol &S,
const uint8_t *Loc) const {
const uint8_t *Loc) const {
return R_ABS;
}

Expand Down Expand Up @@ -281,23 +282,24 @@ static void patch16bytes(uint8_t *Loc, const uint64_t V, uint32_t Begin,
void AIE::relocateAIE1(uint8_t *Loc, const Relocation &rel,
uint64_t Val) const {
if (errorHandler().verbose)
lld::outs() << "Relocation expr=" << rel.expr << " " << rel.type << "@"
<< getErrorLocation(Loc) << "\n";
lld::outs() << "Relocation expr=" << rel.expr << " " << rel.type << "@"
<< getErrorLocation(Loc) << "\n";

// Relocation applied to debug_info
if (rel.expr == R_NONE) {
checkUInt(Loc, Val, 20, rel);
patch4bytes(Loc, Val, 19, 0, 12);
return;
checkUInt(Loc, Val, 20, rel);
patch4bytes(Loc, Val, 19, 0, 12);
return;
}

switch (rel.type) {
// Most relocations are implemented in a file which is
// automatically generated from the processor description.
#include "AIE_rela.inc"

//72 : (symbol_addr_AR + addend ) : addr [19..0]@0 in w08[4] // with default addend 0
//73 : (symbol_addr_AR + addend ) : addr [19..0]@0 in w32[1] // with default addend 0
// 72 : (symbol_addr_AR + addend ) : addr [19..0]@0 in w08[4] //
// with default addend 0 73 : (symbol_addr_AR + addend ) : addr [19..0]@0
// in w32[1] // with default addend 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this requires a manual wrap

case 72:
case 73:
checkUInt(Loc, Val, 20, rel);
Expand Down
Loading