128 lines
4.8 KiB
Diff
128 lines
4.8 KiB
Diff
|
|
This patch creates a SuSE .note section with version number 10.2
|
|
|
|
================================================================================
|
|
Index: Makerules
|
|
===================================================================
|
|
--- Makerules.orig
|
|
+++ Makerules
|
|
@@ -489,6 +489,7 @@ $(common-objpfx)shlib.lds: $(common-objp
|
|
-e '/^=========/,/^=========/!d;/^=========/d' \
|
|
$(if $(filter yes,$(have-hash-style)), \
|
|
-e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \
|
|
+ -e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } .note.SuSE : { *(.note.SuSE) } &/' \
|
|
-e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \
|
|
-e '/DATA_SEGMENT_ALIGN/{H;g}' \
|
|
, \
|
|
@@ -514,7 +515,7 @@ common-generated += shlib.lds
|
|
|
|
define build-shlib
|
|
$(build-shlib-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
|
- $(csu-objpfx)abi-note.o $(build-shlib-objlist)
|
|
+ $(csu-objpfx)abi-note.o $(csu-objpfx)suse-note.o $(build-shlib-objlist)
|
|
endef
|
|
else
|
|
ifneq (,$(findstring aix,$(config-os)))
|
|
@@ -556,7 +557,7 @@ ifeq (yes,$(elf))
|
|
# not for shared objects
|
|
define build-module
|
|
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
|
- $(csu-objpfx)abi-note.o $(build-module-objlist)
|
|
+ $(csu-objpfx)abi-note.o $(csu-objpfx)suse-note.o $(build-module-objlist)
|
|
endef
|
|
define build-module-asneeded
|
|
$(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \
|
|
Index: csu/Makefile
|
|
===================================================================
|
|
--- csu/Makefile.orig
|
|
+++ csu/Makefile
|
|
@@ -125,7 +125,7 @@ $(objpfx)defs.h: $(objpfx)initfini.s
|
|
endif
|
|
|
|
ifeq (yes,$(elf))
|
|
-extra-objs += abi-note.o init.o
|
|
+extra-objs += abi-note.o suse-note.o init.o
|
|
asm-CPPFLAGS += -I$(objpfx).
|
|
endif
|
|
|
|
@@ -143,12 +143,15 @@ ifeq (yes,$(elf))
|
|
# We link the ELF startfile along with a SHT_NOTE section indicating
|
|
# the kernel ABI the binaries linked with this library will require.
|
|
$(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
|
|
+ $(objpfx)suse-note.o \
|
|
$(objpfx)init.o
|
|
$(link-relocatable)
|
|
$(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \
|
|
+ $(objpfx)suse-note.o \
|
|
$(objpfx)init.o
|
|
$(link-relocatable)
|
|
$(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \
|
|
+ $(objpfx)suse-note.ob \
|
|
$(objpfx)init.ob
|
|
$(link-relocatable)
|
|
else
|
|
Index: csu/suse-note.S
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ csu/suse-note.S
|
|
@@ -0,0 +1,59 @@
|
|
+/* Special .init and .fini section support.
|
|
+ Copyright (C) 1997, 2001, 2002 Free Software Foundation, Inc.
|
|
+ This file is part of the GNU C Library.
|
|
+
|
|
+ The GNU C Library is free software; you can redistribute it and/or
|
|
+ modify it under the terms of the GNU Lesser General Public
|
|
+ License as published by the Free Software Foundation; either
|
|
+ version 2.1 of the License, or (at your option) any later version.
|
|
+
|
|
+ In addition to the permissions in the GNU Lesser General Public
|
|
+ License, the Free Software Foundation gives you unlimited
|
|
+ permission to link the compiled version of this file with other
|
|
+ programs, and to distribute those programs without any restriction
|
|
+ coming from the use of this file. (The Lesser General Public
|
|
+ License restrictions do apply in other respects; for example, they
|
|
+ cover modification of the file, and distribution when not linked
|
|
+ into another program.)
|
|
+
|
|
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
+ Lesser General Public License for more details.
|
|
+
|
|
+ You should have received a copy of the GNU Lesser General Public
|
|
+ License along with the GNU C Library; if not, write to the Free
|
|
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
+ 02111-1307 USA. */
|
|
+
|
|
+/* Look in abi-note.S for the definition of an ELF note section. */
|
|
+
|
|
+#include <config.h>
|
|
+
|
|
+#define PROD_TYPE_BOX 0
|
|
+#define PROD_TYPE_SLES 1
|
|
+
|
|
+#define NOTE_VERSION 1
|
|
+#define PROD_TYPE PROD_TYPE_BOX
|
|
+#define PROD_MAJOR 10
|
|
+#define PROD_MINOR 2
|
|
+
|
|
+/* The linker (GNU ld 2.8 and later) recognizes an allocated section whose
|
|
+ name begins with `.note' and creates a PT_NOTE program header entry
|
|
+ pointing at it. */
|
|
+
|
|
+ .section ".note.SuSE", "a"
|
|
+ .p2align 2
|
|
+ .long 1f - 0f /* name length */
|
|
+ .long 3f - 2f /* data length */
|
|
+ .long 0x45537553 /* note type ("SuSE" in little endian) */
|
|
+0: .asciz "SuSE" /* vendor name */
|
|
+1:
|
|
+ .p2align 2
|
|
+2: /* Data */
|
|
+ .byte NOTE_VERSION /* Version of following data */
|
|
+ .byte PROD_TYPE /* product type (box, sles, nld, whatever) */
|
|
+ .byte PROD_MAJOR /* product version */
|
|
+ .byte PROD_MINOR /* product minor version */
|
|
+3:
|
|
+ .p2align 2 /* pad out section */
|