Lines Matching +full:- +full:section

2 # SPDX-License-Identifier: GPL-2.0
7 file ${obj} | grep -q ELF || (echo "${obj} is not an ELF file." 1>&2 ; exit 0)
9 # Bail out early if there isn't an __ex_table section in this object file.
10 objdump -hj __ex_table ${obj} 2> /dev/null > /dev/null
11 [ $? -ne 0 ] && exit 0
15 suspicious_relocs=$(objdump -rj __ex_table ${obj} | tail -n +6 |
16 grep -v $(eval echo -e{${white_list}}) | awk '{print $3}')
19 [ -z "${suspicious_relocs}" ] && exit 0
24 # white listed. If you're adding a new section in the Linux kernel, and
25 # you're expecting this section to contain code which can fault (i.e. the
26 # __ex_table relocation to your new section is expected), simply add your
27 # new section to the white_list variable above. If not, you're probably
33 …eval $(objdump -t ${obj} | grep ${1} | sed 's/\([0-9a-f]\+\) .\{7\} \([^ \t]\+\).*/section="\2"; s…
42 eval $(echo $reloc | sed 's/\([^+]\+\)+\?\(0x[0-9a-f]\+\)\?/symbol="\1"; symbol_offset="\2"/')
44 # When the relocation points to the begining of a symbol or section, it
46 if [ -z "${symbol_offset}" ]; then
55 …eval $(objdump -rj .altinstructions ${obj} | grep -B1 "${section}+${section_offset}" | head -n1 | …
56 sed 's/\([^+]\+\)+\(0x[0-9a-f]\+\)/alt_target_section="\1"; alt_target_offset="\2"/')
62 find_alt_replacement_target ${section} ${section_offset}
65 addr2line -fip -j ${alt_target_section} -e ${obj} ${alt_target_offset} | awk '{print "\t" $0}'
72 objdump -hwj ${section} ${obj} | grep -q CODE
78 if is_executable_section ${section}; then
80 # section, print a warning so the developper adds the section to
81 # the white list or fix his code. We try to pretty-print the file
83 echo "Warning: found a reference to section \"${section}\" in __ex_table:"
84 addr2line -fip -j ${section} -e ${obj} ${section_offset} | awk '{print "\t" $0}'
87 # to a non-executable section, there's no way this would ever be
89 …echo "Error: found a reference to non-executable section \"${section}\" in __ex_table at offset ${…
96 case "${section}" in
98 handle_alt_replacement_reloc ${section} ${section_offset}
101 handle_suspicious_generic_reloc ${section} ${section_offset}
115 # objdump will use it instead of giving us a section+offset, so
116 # let's find out which section is this symbol in and the total
117 # offset withing that section.
121 # rather than a section. Now that we've got the actual section,
123 if [ -z "$( echo $section | grep -v $(eval echo -e{${white_list}}))" ]; then
128 # section we do not know but has executable bit set, or error out.
134 objdump -hj .debug_info ${obj} 2> /dev/null > /dev/null ||
135 echo -e "${obj} does not contain debug information, the addr2line output will be limited.\n" \