File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class Hexagon final : public TargetInfo {
29
29
RelExpr getRelExpr (RelType type, const Symbol &s,
30
30
const uint8_t *loc) const override ;
31
31
RelType getDynRel (RelType type) const override ;
32
+ int64_t getImplicitAddend (const uint8_t *buf, RelType type) const override ;
32
33
void relocate (uint8_t *loc, const Relocation &rel,
33
34
uint64_t val) const override ;
34
35
void writePltHeader (uint8_t *buf) const override ;
@@ -386,6 +387,25 @@ RelType Hexagon::getDynRel(RelType type) const {
386
387
return R_HEX_NONE;
387
388
}
388
389
390
+ int64_t Hexagon::getImplicitAddend (const uint8_t *buf, RelType type) const {
391
+ switch (type) {
392
+ case R_HEX_NONE:
393
+ case R_HEX_GLOB_DAT:
394
+ case R_HEX_JMP_SLOT:
395
+ return 0 ;
396
+ case R_HEX_32:
397
+ case R_HEX_RELATIVE:
398
+ case R_HEX_DTPMOD_32:
399
+ case R_HEX_DTPREL_32:
400
+ case R_HEX_TPREL_32:
401
+ return SignExtend64<32 >(read32 (buf));
402
+ default :
403
+ internalLinkerError (getErrorLocation (buf),
404
+ " cannot read addend for relocation " + toString (type));
405
+ return 0 ;
406
+ }
407
+ }
408
+
389
409
TargetInfo *elf::getHexagonTargetInfo () {
390
410
static Hexagon target;
391
411
return ⌖
Original file line number Diff line number Diff line change @@ -1709,11 +1709,10 @@ static void setConfigs(opt::InputArgList &args) {
1709
1709
OPT_no_apply_dynamic_relocs, false ) ||
1710
1710
!config->isRela ;
1711
1711
// Validation of dynamic relocation addends is on by default for assertions
1712
- // builds (for supported targets) and disabled otherwise. Ideally we would
1713
- // enable the debug checks for all targets, but currently not all targets
1714
- // have support for reading Elf_Rel addends, so we only enable for a subset.
1712
+ // builds and disabled otherwise. This check is enabled when writeAddends is
1713
+ // true.
1715
1714
#ifndef NDEBUG
1716
- bool checkDynamicRelocsDefault = m != EM_HEXAGON ;
1715
+ bool checkDynamicRelocsDefault = true ;
1717
1716
#else
1718
1717
bool checkDynamicRelocsDefault = false ;
1719
1718
#endif
You can’t perform that action at this time.
0 commit comments