Date: Wed, 3 Jul 2019 21:30:18 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349712 - stable/12/sys/kern Message-ID: <201907032130.x63LUI8c029324@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Wed Jul 3 21:30:18 2019 New Revision: 349712 URL: https://svnweb.freebsd.org/changeset/base/349712 Log: MFC r348299 kern/CTF: link_elf_ctf_get() on big endian platforms Check the CTF magic number in big endian platforms. This lets DTrace FBT handle types correctly on these platforms. Modified: stable/12/sys/kern/kern_ctf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_ctf.c ============================================================================== --- stable/12/sys/kern/kern_ctf.c Wed Jul 3 21:05:40 2019 (r349711) +++ stable/12/sys/kern/kern_ctf.c Wed Jul 3 21:30:18 2019 (r349712) @@ -193,8 +193,12 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) NOCRED, NULL, td)) != 0) goto out; - /* Check the CTF magic number. (XXX check for big endian!) */ + /* Check the CTF magic number. */ +#ifdef __LITTLE_ENDIAN__ if (ctf_hdr[0] != 0xf1 || ctf_hdr[1] != 0xcf) { +#else + if (ctf_hdr[0] != 0xcf || ctf_hdr[1] != 0xf1) { +#endif printf("%s(%d): module %s has invalid format\n", __func__, __LINE__, lf->pathname); error = EFTYPE;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907032130.x63LUI8c029324>