fwupd/plugins/uefi/efi/generate_binary.sh
Mario Limonciello e7b2ea02b9 uefi: use genpeimg to mark ASLR and DP/NX on EFI binary
If the tool is available at build time use it to this.
2019-10-26 12:59:11 -05:00

25 lines
534 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 \
-j .rela \
-j .reloc \
$*
if [ -n "${genpeimg_cmd}" ]; then
$genpeimg_cmd -d \
+d \
-d \
+n \
-d \
+s \
$output
fi