Date: Fri, 17 Apr 2009 17:05:31 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r191213 - in releng/7.2/sys: . amd64/amd64 amd64/linux32 arm/arm compat/ia32 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/linux ia64/ia64 kern powerpc/powerpc sparc64/sparc64 sys Message-ID: <200904171705.n3HH5Vng028936@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Fri Apr 17 17:05:31 2009 New Revision: 191213 URL: http://svn.freebsd.org/changeset/base/191213 Log: Merge r190708 from HEAD to releng/7.2: Fix KBI breakage by r190520 which affects older linux.ko binaries: 1) Move the new field (brand_note) to the end of the Brandinfo structure. 2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer is valid. 3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old modules won't have the flag set, so the new field brand_note would be ignored. Suggested by: jhb Reviewed by: jhb Approved by: re (Ken Smith), kib (mentor) Modified: releng/7.2/sys/ (props changed) releng/7.2/sys/amd64/amd64/elf_machdep.c releng/7.2/sys/amd64/linux32/linux32_sysvec.c releng/7.2/sys/arm/arm/elf_machdep.c releng/7.2/sys/compat/ia32/ia32_sysvec.c releng/7.2/sys/contrib/pf/ (props changed) releng/7.2/sys/dev/ath/ath_hal/ (props changed) releng/7.2/sys/dev/cxgb/ (props changed) releng/7.2/sys/i386/i386/elf_machdep.c releng/7.2/sys/i386/linux/linux_sysvec.c releng/7.2/sys/ia64/ia64/elf_machdep.c releng/7.2/sys/kern/imgact_elf.c releng/7.2/sys/powerpc/powerpc/elf_machdep.c releng/7.2/sys/sparc64/sparc64/elf_machdep.c releng/7.2/sys/sys/imgact_elf.h Modified: releng/7.2/sys/amd64/amd64/elf_machdep.c ============================================================================== --- releng/7.2/sys/amd64/amd64/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/amd64/amd64/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -84,7 +84,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -100,7 +100,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- releng/7.2/sys/amd64/linux32/linux32_sysvec.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/amd64/linux32/linux32_sysvec.c Fri Apr 17 17:05:31 2009 (r191213) @@ -1066,7 +1066,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1078,7 +1078,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux32_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: releng/7.2/sys/arm/arm/elf_machdep.c ============================================================================== --- releng/7.2/sys/arm/arm/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/arm/arm/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- releng/7.2/sys/compat/ia32/ia32_sysvec.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/compat/ia32/ia32_sysvec.c Fri Apr 17 17:05:31 2009 (r191213) @@ -148,7 +148,7 @@ static Elf32_Brandinfo ia32_brand_info = .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -164,7 +164,7 @@ static Elf32_Brandinfo ia32_brand_oinfo .sysvec = &ia32_freebsd_sysvec, .interp_newpath = "/libexec/ld-elf32.so.1", .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/i386/i386/elf_machdep.c ============================================================================== --- releng/7.2/sys/i386/i386/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/i386/i386/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/i386/linux/linux_sysvec.c ============================================================================== --- releng/7.2/sys/i386/linux/linux_sysvec.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/i386/linux/linux_sysvec.c Fri Apr 17 17:05:31 2009 (r191213) @@ -1036,7 +1036,7 @@ static Elf32_Brandinfo linux_brand = { .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; static Elf32_Brandinfo linux_glibc2brand = { @@ -1048,7 +1048,7 @@ static Elf32_Brandinfo linux_glibc2brand .sysvec = &elf_linux_sysvec, .interp_newpath = NULL, .brand_note = &linux_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; Elf32_Brandinfo *linux_brandlist[] = { Modified: releng/7.2/sys/ia64/ia64/elf_machdep.c ============================================================================== --- releng/7.2/sys/ia64/ia64/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/ia64/ia64/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -92,7 +92,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info); @@ -106,7 +106,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo); Modified: releng/7.2/sys/kern/imgact_elf.c ============================================================================== --- releng/7.2/sys/kern/imgact_elf.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/kern/imgact_elf.c Fri Apr 17 17:05:31 2009 (r191213) @@ -192,7 +192,7 @@ __elfN(get_brandinfo)(struct image_param for (i = 0; i < MAX_BRANDS; i++) { bi = elf_brand_list[i]; if (bi != NULL && hdr->e_machine == bi->machine && - bi->brand_note != NULL) { + (bi->flags & BI_BRAND_NOTE) != 0) { ret = __elfN(check_note)(imgp, bi->brand_note, osrel); if (ret) return (bi); Modified: releng/7.2/sys/powerpc/powerpc/elf_machdep.c ============================================================================== --- releng/7.2/sys/powerpc/powerpc/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/powerpc/powerpc/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -87,7 +87,7 @@ static Elf32_Brandinfo freebsd_brand_inf .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, @@ -103,7 +103,7 @@ static Elf32_Brandinfo freebsd_brand_oin .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/sparc64/sparc64/elf_machdep.c ============================================================================== --- releng/7.2/sys/sparc64/sparc64/elf_machdep.c Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/sparc64/sparc64/elf_machdep.c Fri Apr 17 17:05:31 2009 (r191213) @@ -99,7 +99,7 @@ static Elf64_Brandinfo freebsd_brand_inf .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -115,7 +115,7 @@ static Elf64_Brandinfo freebsd_brand_oin .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, Modified: releng/7.2/sys/sys/imgact_elf.h ============================================================================== --- releng/7.2/sys/sys/imgact_elf.h Fri Apr 17 17:00:20 2009 (r191212) +++ releng/7.2/sys/sys/imgact_elf.h Fri Apr 17 17:05:31 2009 (r191213) @@ -70,9 +70,10 @@ typedef struct { const char *interp_path; struct sysentvec *sysvec; const char *interp_newpath; - Elf_Brandnote *brand_note; int flags; + Elf_Brandnote *brand_note; #define BI_CAN_EXEC_DYN 0x0001 +#define BI_BRAND_NOTE 0x0002 } __ElfN(Brandinfo); __ElfType(Auxargs);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904171705.n3HH5Vng028936>