Skip to content

Commit

Permalink
[llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Browse files Browse the repository at this point in the history
Reported by: mikael.holmen at ericsson.com


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251117 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dcci committed Oct 23, 2015
1 parent 53fbda2 commit 9d03be0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/llvm-readobj/ELFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void printVersionSymbolSection(ELFDumper<ELFT> *Dumper,
W.printNumber("Link", Sec->sh_link);

const typename ELFO::Elf_Shdr *DynSymSec = Dumper->getDotDynSymSec();
uint8_t *P = (uint8_t *)Obj->base() + Sec->sh_offset;
const uint8_t *P = (const uint8_t *)Obj->base() + Sec->sh_offset;
ErrorOr<StringRef> StrTableOrErr =
Obj->getStringTableForSymtab(*DynSymSec);
error(StrTableOrErr.getError());
Expand Down Expand Up @@ -359,9 +359,10 @@ static void printVersionDefinitionSection(ELFDumper<ELFT> *Dumper,
if (Dyn.d_tag == DT_VERDEFNUM)
verdef_entries = Dyn.d_un.d_val;
}
uint8_t *SecStartAddress = (uint8_t *)Obj->base() + Sec->sh_offset;
uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size;
uint8_t *P = SecStartAddress;
const uint8_t *SecStartAddress =
(const uint8_t *)Obj->base() + Sec->sh_offset;
const uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size;
const uint8_t *P = SecStartAddress;
ErrorOr<const typename ELFO::Elf_Shdr *> StrTabOrErr =
Obj->getSection(Sec->sh_link);
error(StrTabOrErr.getError());
Expand All @@ -378,9 +379,9 @@ static void printVersionDefinitionSection(ELFDumper<ELFT> *Dumper,
W.printNumber("Flags", VD->vd_flags);
W.printNumber("Index", VD->vd_ndx);
W.printNumber("Cnt", VD->vd_cnt);
W.printString("Name", StringRef((char *)(
Obj->base() + (*StrTabOrErr)->sh_offset +
VD->getAux()->vda_name)));
W.printString("Name", StringRef((const char *)(Obj->base() +
(*StrTabOrErr)->sh_offset +
VD->getAux()->vda_name)));
P += VD->vd_next;
}
}
Expand Down

0 comments on commit 9d03be0

Please sign in to comment.