[PATCH] D35005: [ELF] - Do not apply relocations to .debug_ranges when building -gdb-index

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 10:23:15 PDT 2017


> +  ObjectInfo(const object::ObjectFile &Obj)
> +      : ElfObj(cast<ELFObjectFile<ELFT>>(Obj)) {}
> +
> +  bool relocate(const object::SectionRef &RelSec,
> +                RelocAddrMap *Map) const override {
> +    StringRef S;
> +    if (std::error_code EC = RelSec.getName(S))
> +      return false;

Should we really just eat this error?

> +    if (S == ".rela.debug_ranges" || S == ".rel.debug_ranges")
> +      return relocateDebugRanges(RelSec, Map);
> +    return false;
> +  }

Please expand the description. It looks like you relocate *only*
.debug_ranges, no?

Cheers,
Rafael


More information about the llvm-commits mailing list