-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[ELF] Rename IsRela to HasAddend #96592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -492,7 +492,8 @@ int64_t RelocationScanner::computeMipsAddend(const RelTy &rel, RelExpr expr, | |
|
||
// The ABI says that the paired relocation is used only for REL. | ||
// See p. 4-17 at ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf | ||
if (RelTy::IsRela) | ||
// This generalises to relocation types with implicit addends. | ||
if (RelTy::HasAddend) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming MIPS will support CREL, but the ABI won't be updated to explicitly mention it, could be worth a small addition at the end.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thx. Added. (I think MIPS will die before anyone implements CREL for it...) |
||
return 0; | ||
|
||
RelType type = rel.getType(config->isMips64EL); | ||
|
@@ -1448,7 +1449,7 @@ template <class ELFT, class RelTy> void RelocationScanner::scanOne(RelTy *&i) { | |
return; | ||
|
||
RelExpr expr = target->getRelExpr(type, sym, sec->content().data() + offset); | ||
int64_t addend = RelTy::IsRela | ||
int64_t addend = RelTy::HasAddend | ||
? getAddend<ELFT>(rel) | ||
: target->getImplicitAddend( | ||
sec->content().data() + rel.r_offset, type); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comment above might be worth updating assuming CREL will behave in the same way. Perhaps something like: