Skip to content
Snippets Groups Projects
Commit 18038042 authored by Brad King's avatar Brad King
Browse files

cmelf: Add script to import the FreeBSD ELF headers


These headers will be used to provide the ELF parsing code on all host
operating systems (including those that don't have an ELF header, e.g.
macOS).  This will also allow removing various OS-dependent #ifdefs from
the cmELF code.  Add a script that was used to automate this import.

Co-authored-by: default avatarAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
parent 6c5f21d1
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
set -e
set -x
shopt -s dotglob
readonly name="elf"
readonly ownership="FreeBSD Upstream <kwrobot@kitware.com>"
readonly subtree="Utilities/cmelf"
readonly repo="https://github.com/freebsd/freebsd-src.git"
readonly tag="main"
readonly shortlog=false
readonly paths="
sys/sys/elf32.h
sys/sys/elf64.h
sys/sys/elf_common.h
"
extract_source () {
git_archive
pushd "${extractdir}/${name}-reduced"
echo "* -whitespace" > .gitattributes
mv sys/sys/* .
sed -i -e 's/<sys\/elf_common.h>/"elf_common.h"/g' -e 's/u_int32_t/uint32_t/g' *.h
popd
}
. "${BASH_SOURCE%/*}/update-third-party.bash"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment