From 2408b715a04f6a51269044473eb72c51e41c48dd Mon Sep 17 00:00:00 2001 From: dchagin Date: Fri, 13 Mar 2009 16:40:51 +0000 Subject: Implement new way of branding ELF binaries by looking to a ".note.ABI-tag" section. The search order of a brand is changed, now first of all the ".note.ABI-tag" is looked through. Move code which fetch osreldate for ELF binary to check_note() handler. PR: 118473 Approved by: kib (mentor) --- sys/mips/mips/elf64_machdep.c | 2 ++ sys/mips/mips/elf_machdep.c | 1 + 2 files changed, 3 insertions(+) (limited to 'sys/mips') diff --git a/sys/mips/mips/elf64_machdep.c b/sys/mips/mips/elf64_machdep.c index e5a2f5d..dffa134 100644 --- a/sys/mips/mips/elf64_machdep.c +++ b/sys/mips/mips/elf64_machdep.c @@ -88,6 +88,7 @@ static Elf64_Brandinfo freebsd_brand_gnutools_info64 = { .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_path = "/libexec/ld-elf.so.1", + .brand_note = &elf64_freebsd_brandnote, .flags = BI_CAN_EXEC_DYN }; @@ -103,6 +104,7 @@ static Elf64_Brandinfo freebsd_brand_info64 = { .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, + .brand_note = &elf64_freebsd_brandnote, .flags = 0 }; diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c index 163d0ee..8eade98 100644 --- a/sys/mips/mips/elf_machdep.c +++ b/sys/mips/mips/elf_machdep.c @@ -86,6 +86,7 @@ static Elf32_Brandinfo freebsd_brand_info = { .interp_path = "/libexec/ld-elf.so.1", .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, + .brand_note = &elf32_freebsd_brandnote, .flags = 0 }; -- cgit v1.1 From 7695aca762c11a65c2cb77f36c495e0e77dcd2aa Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 17 Mar 2009 12:50:16 +0000 Subject: Add AT_EXECPATH ELF auxinfo entry type. The value's a_ptr is a pointer to the full path of the image that is being executed. Increase AT_COUNT. Remove no longer true comment about types used in Linux ELF binaries, listed types contain FreeBSD-specific entries. Reviewed by: kan --- sys/mips/include/elf.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/mips') diff --git a/sys/mips/include/elf.h b/sys/mips/include/elf.h index 6e48ec1..3a31daa 100644 --- a/sys/mips/include/elf.h +++ b/sys/mips/include/elf.h @@ -241,15 +241,13 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ #endif /* !_MACHINE_ELF_H_ */ -- cgit v1.1 From 454fcf41e6df0a4529ca2346ac41cb9d8c6b404e Mon Sep 17 00:00:00 2001 From: bz Date: Sat, 28 Mar 2009 23:24:34 +0000 Subject: Mark the declaration of bus_space_map 'static' as the implementation is. Follow one of the two most common indent schemes in this file. This unbreaks a few mips kernel builds. --- sys/mips/include/bus.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/mips') diff --git a/sys/mips/include/bus.h b/sys/mips/include/bus.h index 42ac1df..92557d7 100644 --- a/sys/mips/include/bus.h +++ b/sys/mips/include/bus.h @@ -101,8 +101,9 @@ * Map a region of device bus space into CPU virtual address space. */ -__inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, bus_space_handle_t *bshp); +static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t *bshp); static __inline int bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, -- cgit v1.1 From 01bf63c9fb60c7104bfbbcfd5be8c1deab29ea6a Mon Sep 17 00:00:00 2001 From: dchagin Date: Sun, 5 Apr 2009 09:27:19 +0000 Subject: 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: kib (mentor) MFC after: 6 days --- sys/mips/mips/elf64_machdep.c | 4 ++-- sys/mips/mips/elf_machdep.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/mips') diff --git a/sys/mips/mips/elf64_machdep.c b/sys/mips/mips/elf64_machdep.c index dffa134..c10fb5f 100644 --- a/sys/mips/mips/elf64_machdep.c +++ b/sys/mips/mips/elf64_machdep.c @@ -89,7 +89,7 @@ static Elf64_Brandinfo freebsd_brand_gnutools_info64 = { .sysvec = &elf64_freebsd_sysvec, .interp_path = "/libexec/ld-elf.so.1", .brand_note = &elf64_freebsd_brandnote, - .flags = BI_CAN_EXEC_DYN + .flags = BI_CAN_EXEC_DYN | BI_BRAND_NOTE }; SYSINIT(gnu_mips_elf64, SI_SUB_EXEC, SI_ORDER_ANY, @@ -105,7 +105,7 @@ static Elf64_Brandinfo freebsd_brand_info64 = { .sysvec = &elf64_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf64_freebsd_brandnote, - .flags = 0 + .flags = BI_BRAND_NOTE }; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, diff --git a/sys/mips/mips/elf_machdep.c b/sys/mips/mips/elf_machdep.c index 8eade98..19cb1a1 100644 --- a/sys/mips/mips/elf_machdep.c +++ b/sys/mips/mips/elf_machdep.c @@ -87,7 +87,7 @@ static Elf32_Brandinfo freebsd_brand_info = { .sysvec = &elf32_freebsd_sysvec, .interp_newpath = NULL, .brand_note = &elf32_freebsd_brandnote, - .flags = 0 + .flags = BI_BRAND_NOTE }; SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY, -- cgit v1.1