From: "Jan Beulich" Subject: [PATCH] libelf: move to init text/data when built for the hypervisor Date: Thu, 04 Nov 2010 15:04:00 +0000 Message-ID: <4CD2D970020000780002096F@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4D60DE70.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4D60DE70.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Rather than annotating each and every function and data object (and then still missing some compiler generated ones, plus getting into ugliness due to the code also being built from tools/libxc/), use objcopy to rename all relevant sections. Signed-off-by: Jan Beulich --- a/xen/arch/ia64/xen/xen.lds.S +++ b/xen/arch/ia64/xen/xen.lds.S @@ -120,7 +120,13 @@ SECTIONS } =20 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) - { *(.init.data) } + { + *(.init.rodata) + *(.init.rodata.str*) + *(.init.data) + *(.init.data.rel) + *(.init.data.rel.*) + } =20 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -79,7 +79,11 @@ SECTIONS _einittext =3D .; } :text .init.data : { + *(.init.rodata) + *(.init.rodata.str*) *(.init.data) + *(.init.data.rel) + *(.init.data.rel.*) } :text . =3D ALIGN(32); .init.setup : { --- a/xen/common/libelf/Makefile +++ b/xen/common/libelf/Makefile @@ -1,4 +1,9 @@ -obj-y +=3D libelf-tools.o -obj-y +=3D libelf-loader.o -obj-y +=3D libelf-dominfo.o -#obj-y +=3D libelf-relocate.o +obj-y :=3D libelf.o + +SECTIONS :=3D text data rodata $(foreach n,1 2 4 8,rodata.str1.$(n)) = $(foreach r,rel rel.ro,data.$(r) data.$(r).local) + +libelf.o: libelf-temp.o Makefile + $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section .$(s)=3D.init.$= (s)) $< $@ + +libelf-temp.o: libelf-tools.o libelf-loader.o libelf-dominfo.o #libelf-rel= ocate.o + $(LD) $(LDFLAGS) -r -o $@ $^ --=__Part4D60DE70.0__= Content-Type: text/plain; name="libelf-init.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libelf-init.patch" Rather than annotating each and every function and data object (and=0Athen = still missing some compiler generated ones, plus getting into=0Augliness = due to the code also being built from tools/libxc/), use=0Aobjcopy to = rename all relevant sections.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/arch/ia64/xen/xen.lds.S=0A+++ b/xen/arch/ia64/xen/x= en.lds.S=0A@@ -120,7 +120,13 @@ SECTIONS=0A }=0A =0A .init.data : = AT(ADDR(.init.data) - LOAD_OFFSET)=0A- { *(.init.data) }=0A+ {=0A+ = *(.init.rodata)=0A+ *(.init.rodata.str*)=0A+ *(.init.data)=0A+= *(.init.data.rel)=0A+ *(.init.data.rel.*)=0A+ }=0A =0A = .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)=0A {=0A--- a/xen/arch/= x86/xen.lds.S=0A+++ b/xen/arch/x86/xen.lds.S=0A@@ -79,7 +79,11 @@ = SECTIONS=0A _einittext =3D .;=0A } :text=0A .init.data : {=0A+ = *(.init.rodata)=0A+ *(.init.rodata.str*)=0A *(.init.data)= =0A+ *(.init.data.rel)=0A+ *(.init.data.rel.*)=0A } :text=0A = . =3D ALIGN(32);=0A .init.setup : {=0A--- a/xen/common/libelf/Makefile= =0A+++ b/xen/common/libelf/Makefile=0A@@ -1,4 +1,9 @@=0A-obj-y +=3D = libelf-tools.o=0A-obj-y +=3D libelf-loader.o=0A-obj-y +=3D libelf-dominfo.o= =0A-#obj-y +=3D libelf-relocate.o=0A+obj-y :=3D libelf.o=0A+=0A+SECTIONS = :=3D text data rodata $(foreach n,1 2 4 8,rodata.str1.$(n)) $(foreach = r,rel rel.ro,data.$(r) data.$(r).local)=0A+=0A+libelf.o: libelf-temp.o = Makefile=0A+ $(OBJCOPY) $(foreach s,$(SECTIONS),--rename-section = .$(s)=3D.init.$(s)) $< $@=0A+=0A+libelf-temp.o: libelf-tools.o libelf-loade= r.o libelf-dominfo.o #libelf-relocate.o=0A+ $(LD) $(LDFLAGS) -r -o $@ = $^=0A --=__Part4D60DE70.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part4D60DE70.0__=--