History

scripts/faddr2line: Fix vmlinux detection on arm64

Since commit dcea997beed6 ("faddr2line: Fix overlapping text section failures, the sequel"), faddr2line is completely broken on arm64. For some reason, on arm64, the vmlinux ELF object file type is ET_DYN rather than ET_EXEC. Check for both when determining whether the object is vmlinux. Modules and vmlinux.o have type ET_REL on all arches.

Josh Poimboeuf committed 4 years ago

Commit b6a50681 parent dec87841 file · +3 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/faddr2line+3−1
@@ -112,7 +112,9 @@ __faddr2line() { · 111 unmodified lines
112112 # section offsets.
113113 local file_type=$(${READELF} --file-header $objfile |
114114 ${AWK} '$1 == "Type:" { print $2; exit }')
115− [[ $file_type = "EXEC" ]] && is_vmlinux=1
115+ if [[ $file_type = "EXEC" ]] || [[ $file_type == "DYN" ]]; then
116+ is_vmlinux=1
117+ fi
116118
117119 # Go through each of the object's symbols which match the func name.
118120 # In rare cases there might be duplicates, in which case we print all