[llvm] r260488 - [readobj] Handle ELF files with no section table or with no program headers.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 14:15:39 PST 2016


There are a few problems with this patch

>    uint32_t Index = Sym->st_shndx;
>    if (Index == ELF::SHN_XINDEX)
> -    return getSection(getExtendedSymbolTableIndex(Sym, SymTab, ShndxTable));
> +    return getSection(
> +        getExtendedSymbolTableIndex(Sym, symbol_begin(SymTab), ShndxTable));


Why call the more complicated version in here?

>
> -RUN: not llvm-readobj -dynamic-table \
> -RUN:   %p/Inputs/corrupt-invalid-virtual-addr.elf.x86-64 2>&1 | \
> -RUN:   FileCheck --check-prefix=VIRTADDR %s
> -
> -VIRTADDR: Virtual address is not in any segment

Why is this not an error anymore?

>    Elf_Dyn_Range dynamic_table() const {
> -    ErrorOr<Elf_Dyn_Range> Ret = Obj->dynamic_table(DynamicProgHeader);
> -    error(Ret.getError());
> -    return *Ret;
> +    return DynamicTable.getAsRange<Elf_Dyn>();
> +  }

This and other uses of DynamicTable are a refactoring. They should
have been committed independently of other changes.

Could you revert this and send it back for review? Please split it up too.

Cheers,
Rafael


More information about the llvm-commits mailing list