Enable -Wold-style-cast warnings for linker

And fix old style casts.

Change-Id: I37e7a3e3fd852528ea76f02d967c7bd8cd5b06c9
This commit is contained in:
Dmitriy Ivanov
2015-01-22 16:04:25 -08:00
parent ae095a730d
commit 1649e7ee5b
5 changed files with 15 additions and 10 deletions

View File

@@ -688,7 +688,7 @@ int phdr_table_map_gnu_relro(const ElfW(Phdr)* phdr_table, size_t phdr_count, El
*/
int phdr_table_get_arm_exidx(const ElfW(Phdr)* phdr_table, size_t phdr_count,
ElfW(Addr) load_bias,
ElfW(Addr)** arm_exidx, unsigned* arm_exidx_count) {
ElfW(Addr)** arm_exidx, size_t* arm_exidx_count) {
const ElfW(Phdr)* phdr = phdr_table;
const ElfW(Phdr)* phdr_limit = phdr + phdr_count;
@@ -698,7 +698,7 @@ int phdr_table_get_arm_exidx(const ElfW(Phdr)* phdr_table, size_t phdr_count,
}
*arm_exidx = reinterpret_cast<ElfW(Addr)*>(load_bias + phdr->p_vaddr);
*arm_exidx_count = (unsigned)(phdr->p_memsz / 8);
*arm_exidx_count = phdr->p_memsz / 8;
return 0;
}
*arm_exidx = nullptr;
@@ -757,7 +757,7 @@ bool ElfReader::FindPhdr() {
ElfW(Addr) elf_addr = load_bias_ + phdr->p_vaddr;
const ElfW(Ehdr)* ehdr = reinterpret_cast<const ElfW(Ehdr)*>(elf_addr);
ElfW(Addr) offset = ehdr->e_phoff;
return CheckPhdr((ElfW(Addr))ehdr + offset);
return CheckPhdr(reinterpret_cast<ElfW(Addr)>(ehdr) + offset);
}
break;
}