Merge branch 'objtool/urgent'
Fixup conflicts. # Conflicts: # tools/objtool/check.c
This commit is contained in:
@@ -369,7 +369,7 @@ static int decode_instructions(struct objtool_file *file)
|
||||
!strcmp(sec->name, ".entry.text"))
|
||||
sec->noinstr = true;
|
||||
|
||||
for (offset = 0; offset < sec->len; offset += insn->len) {
|
||||
for (offset = 0; offset < sec->sh.sh_size; offset += insn->len) {
|
||||
insn = malloc(sizeof(*insn));
|
||||
if (!insn) {
|
||||
WARN("malloc failed");
|
||||
@@ -383,7 +383,7 @@ static int decode_instructions(struct objtool_file *file)
|
||||
insn->offset = offset;
|
||||
|
||||
ret = arch_decode_instruction(file, sec, offset,
|
||||
sec->len - offset,
|
||||
sec->sh.sh_size - offset,
|
||||
&insn->len, &insn->type,
|
||||
&insn->immediate,
|
||||
&insn->stack_ops);
|
||||
@@ -501,9 +501,9 @@ static struct instruction *find_last_insn(struct objtool_file *file,
|
||||
{
|
||||
struct instruction *insn = NULL;
|
||||
unsigned int offset;
|
||||
unsigned int end = (sec->len > 10) ? sec->len - 10 : 0;
|
||||
unsigned int end = (sec->sh.sh_size > 10) ? sec->sh.sh_size - 10 : 0;
|
||||
|
||||
for (offset = sec->len - 1; offset >= end && !insn; offset--)
|
||||
for (offset = sec->sh.sh_size - 1; offset >= end && !insn; offset--)
|
||||
insn = find_insn(file, sec, offset);
|
||||
|
||||
return insn;
|
||||
@@ -541,7 +541,7 @@ static int add_dead_ends(struct objtool_file *file)
|
||||
insn = find_insn(file, reloc->sym->sec, reloc->addend);
|
||||
if (insn)
|
||||
insn = list_prev_entry(insn, list);
|
||||
else if (reloc->addend == reloc->sym->sec->len) {
|
||||
else if (reloc->addend == reloc->sym->sec->sh.sh_size) {
|
||||
insn = find_last_insn(file, reloc->sym->sec);
|
||||
if (!insn) {
|
||||
WARN("can't find unreachable insn at %s+0x%x",
|
||||
@@ -576,7 +576,7 @@ reachable:
|
||||
insn = find_insn(file, reloc->sym->sec, reloc->addend);
|
||||
if (insn)
|
||||
insn = list_prev_entry(insn, list);
|
||||
else if (reloc->addend == reloc->sym->sec->len) {
|
||||
else if (reloc->addend == reloc->sym->sec->sh.sh_size) {
|
||||
insn = find_last_insn(file, reloc->sym->sec);
|
||||
if (!insn) {
|
||||
WARN("can't find reachable insn at %s+0x%x",
|
||||
@@ -1726,14 +1726,14 @@ static int read_unwind_hints(struct objtool_file *file)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (sec->len % sizeof(struct unwind_hint)) {
|
||||
if (sec->sh.sh_size % sizeof(struct unwind_hint)) {
|
||||
WARN("struct unwind_hint size mismatch");
|
||||
return -1;
|
||||
}
|
||||
|
||||
file->hints = true;
|
||||
|
||||
for (i = 0; i < sec->len / sizeof(struct unwind_hint); i++) {
|
||||
for (i = 0; i < sec->sh.sh_size / sizeof(struct unwind_hint); i++) {
|
||||
hint = (struct unwind_hint *)sec->data->d_buf + i;
|
||||
|
||||
reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint));
|
||||
|
||||
Reference in New Issue
Block a user