ELF binary type ... not known.

Trying to upgrade last night made these errors:
Installing linux-c6-gdk-pixbuf2-2.24.1_5...
ELF binary type "0" not known.
/compat/linux/usr/bin/gdk-pixbuf-query-loaders-64: Exec format error
ELF binary type "3" not known.
/compat/linux/sbin/ldconfig: Exec format error
pkg-static: POST-INSTALL script failed
What's that about?
FreeBSD 10.3-STABLE amd64
Well, I have this linux64 issue for a long time (and this time additionally it even didn't portupgrade'd the port at first). kldload linux64 gives
kldload: an error occurred while loading the module. Please check dmesg(8) for more details.

link_elf_obj: symbol elf64_linux_shared_page_fini undefined
linker_load_file: Unsupported file type
The same error I see during reboot. And I couldn't find a solution or any instructions in Handbook concerning linux64. (I have a custom kernel.)

P. S. And in /usr/src/sys/amd64/conf/NOTES options COMPAT_LINUX line is marked with #XXX# which is confusing. And,
/usr/src/sys/amd64/conf/GJA822M: unknown option "COMPAT_LINUX"
It was just an idea. On FreeBSD 11.0 with GENERIC kernel kldload linux64 loads the module. May be others can help you if you could post the diference between the GENERIC kernel and your cusomized kernel. At least I wish you good luck and success!
Well, the only idea I have, is that kernel config options COMPAT_LINUX32 isn't for some reason the same as linux_enable="YES" in /etc/rc.conf or kldload linux; kldload linux64 without linux options in kernel. (For example, because there's no working options COMPAT_LINUX for kernel config as I said earlier.)
Again, Handbook doesn't help on that issue.