mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
libelf: move to init text/data when built for the hypervisor
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 <jbeulich@novell.com>
This commit is contained in:
1 parent
0cd09703b1
commit
f2136c6133
3 files changed
+20
-5
No files matched your search
@@ -120,7 +120,13 @@ SECTIONS
|
||||
}
|
||||
|
||||
.init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
|
||||
{ *(.init.data) }
|
||||
{
|
||||
*(.init.rodata)
|
||||
*(.init.rodata.str*)
|
||||
*(.init.data)
|
||||
*(.init.data.rel)
|
||||
*(.init.data.rel.*)
|
||||
}
|
||||
|
||||
.init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,11 @@ SECTIONS
|
||||
_einittext = .;
|
||||
} :text
|
||||
.init.data : {
|
||||
*(.init.rodata)
|
||||
*(.init.rodata.str*)
|
||||
*(.init.data)
|
||||
*(.init.data.rel)
|
||||
*(.init.data.rel.*)
|
||||
} :text
|
||||
. = ALIGN(32);
|
||||
.init.setup : {
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
obj-y += libelf-tools.o
|
||||
obj-y += libelf-loader.o
|
||||
obj-y += libelf-dominfo.o
|
||||
#obj-y += libelf-relocate.o
|
||||
obj-y := libelf.o
|
||||
|
||||
SECTIONS := 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)=.init.$(s)) $< $@
|
||||
|
||||
libelf-temp.o: libelf-tools.o libelf-loader.o libelf-dominfo.o #libelf-relocate.o
|
||||
$(LD) $(LDFLAGS) -r -o $@ $^
|
||||