linux-stable/tools
Allan Xavier f1a58e1bca objtool: Support per-function rodata sections
commit 4a60aa05a0 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-25 11:36:50 +08:00
..
accounting License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch tools headers: Synchronise x86 cpufeatures.h for L1TF additions 2018-08-15 18:13:01 +02:00
build tools: build: Use HOSTLDFLAGS with fixdep 2018-08-24 13:09:17 +02:00
cgroup tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
hv Tools: hv: kvp: Fix a warning of buffer overflow with gcc 8.0.1 2019-02-12 19:45:58 +01:00
iio tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
include tools include: Adopt linux/bits.h 2019-04-27 09:35:41 +02:00
kvm/kvm_stat tools/kvm_stat: fix handling of invalid paths in debugfs provider 2018-10-10 08:54:20 +02:00
laptop tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
leds tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
lib libbpf: fix samples/bpf build failure due to undefined UINT32_MAX 2019-05-31 06:47:22 -07:00
net bpf: fix uninitialized variable in bpf tools 2018-06-21 04:02:49 +09:00
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
objtool objtool: Support per-function rodata sections 2019-06-25 11:36:50 +08:00
pci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf perf record: Fix s390 missing module symbol and warning for non-root users 2019-06-22 08:16:17 +02:00
power x86/msr-index: Cleanup bit defines 2019-05-14 19:18:42 +02:00
scripts tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
spi tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
testing selftests: netfilter: missing error check when setting up veth interface 2019-06-22 08:16:16 +02:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-05-30 07:52:28 +02:00
time
usb usbip: fix vhci_hcd controller counting 2019-04-20 09:15:05 +02:00
virtio virtio: fix test build after uio.h change 2019-01-13 10:01:01 +01:00
vm tools: fix cross-compile var clobbering 2019-01-13 10:01:02 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00