+elf_section_exists ()
+{
+ local ELF="$1"
+ local SEC="$2"
+
+ objdump -h -j "$SEC" "$ELF" &> /dev/null
+}
+
+# Extract a set of unique symbols for a specified section.
+elf_extract_section_symbols ()
+{
+ local -r ELF="$1"
+ local -r SEC="$2"
+
+ if elf_section_exists "$ELF" "$SEC"
+ then
+ # Example objdump command output to be parsed:
+ #
+ # SYMBOL TABLE:
+ # 0000000000000000 l d .livepatch.funcs 0000000000000000 .livepatch.funcs
+ objdump -w -j "$SEC" -t "$ELF" | awk '/^SYMBOL TABLE:/ {seen = 1; next} seen && $NF {print $NF}' | sort -u
+ fi
+}
+
+# Strip all metadata symbols belonging to a metadata section
+# or whose name starts with a livepatch hook prefix.
+# The function constructs the 'strip' utility command line
+# and then invokes strip with that command line.
+strip_metadata_symbols ()