Date: Mon, 27 May 2019 04:20:32 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r348299 - head/sys/kern Message-ID: <201905270420.x4R4KWOF080149@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Mon May 27 04:20:31 2019 New Revision: 348299 URL: https://svnweb.freebsd.org/changeset/base/348299 Log: 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. Submitted by: Brandon Bergren MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20413 Modified: head/sys/kern/kern_ctf.c Modified: head/sys/kern/kern_ctf.c ============================================================================== --- head/sys/kern/kern_ctf.c Mon May 27 03:18:56 2019 (r348298) +++ head/sys/kern/kern_ctf.c Mon May 27 04:20:31 2019 (r348299) @@ -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?201905270420.x4R4KWOF080149>