diff options
author | Allan Xavier <allan.x.xavier@oracle.com> | 2018-09-07 08:12:01 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-09-08 12:33:01 +0200 |
commit | 4a60aa05a0634241ce17f957bf9fb5ac1eed6576 (patch) | |
tree | a2d6485ec7019385179eaf6c526cd9ab87dcd193 /tools/objtool/elf.h | |
parent | db44bf4b4768a0664d3c9d9000ecb747de31ded8 (diff) | |
download | linux-4a60aa05a0634241ce17f957bf9fb5ac1eed6576.tar.gz linux-4a60aa05a0634241ce17f957bf9fb5ac1eed6576.tar.bz2 linux-4a60aa05a0634241ce17f957bf9fb5ac1eed6576.zip |
objtool: Support per-function rodata sections
Add support for processing switch jump tables in objects with multiple
.rodata sections, such as those created by '-ffunction-sections' and
'-fdata-sections'. Currently, objtool always looks in .rodata for jump
table information, which results in many "sibling call from callable
instruction with modified stack frame" warnings with objects compiled
using those flags.
The fix is comprised of three parts:
1. Flagging all .rodata sections when importing ELF information for
easier checking later.
2. Keeping a reference to the section each relocation is from in order
to get the list_head for the other relocations in that section.
3. Finding jump tables by following relocations to .rodata sections,
rather than always referencing a single global .rodata section.
The patch has been tested without data sections enabled and no
differences in the resulting orc unwind information were seen.
Note that as objtool adds terminators to end of each .text section the
unwind information generated between a function+data sections build and
a normal build aren't directly comparable. Manual inspection suggests
that objtool is now generating the correct information, or at least
making more of an effort to do so than it did previously.
Signed-off-by: Allan Xavier <allan.x.xavier@oracle.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/099bdc375195c490dda04db777ee0b95d566ded1.1536325914.git.jpoimboe@redhat.com
Diffstat (limited to 'tools/objtool/elf.h')
-rw-r--r-- | tools/objtool/elf.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h index de5cd2ddded9..bc97ed86b9cd 100644 --- a/tools/objtool/elf.h +++ b/tools/objtool/elf.h @@ -48,7 +48,7 @@ struct section { char *name; int idx; unsigned int len; - bool changed, text; + bool changed, text, rodata; }; struct symbol { @@ -68,6 +68,7 @@ struct rela { struct list_head list; struct hlist_node hash; GElf_Rela rela; + struct section *rela_sec; struct symbol *sym; unsigned int type; unsigned long offset; |