fwupd/plugins/uefi/efi/generate_binary.sh
YiFei Zhu 8b044c6cb3 efi: use a wildcard section copy for final EFI generation
The GNU gold linker uses the section name `.rela.dyn` instead of
`.rela` for containing the relocation information. If this section
is not copied the EFI executable can crash.

Fixes #1530
2019-11-14 09:46:50 +00:00

23 lines
486 B
Bash
Executable File

#!/bin/sh
output=$2
objcopy_cmd=$(which objcopy)
genpeimg_cmd=$(which genpeimg)
$objcopy_cmd -j .text \
-j .sdata \
-j .data \
-j .dynamic \
-j .dynsym \
-j '.rel*' \
$*
if [ -n "${genpeimg_cmd}" ]; then
$genpeimg_cmd -d \
+d \
-d \
+n \
-d \
+s \
$output
fi