mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-01 11:36:43 +00:00
os: reenable -fPIC and fix policy linkerscript
As it turns out using -fPIC was not the issue but discarding certain sections. The policy_module_table is now located in .data.rel which needs to be at the beginning of the binary. Fixes #849.
This commit is contained in:
parent
5afb5fcc12
commit
d2f7c7bec4
@ -4,7 +4,7 @@
|
||||
# \date 2013-08-12
|
||||
#
|
||||
|
||||
CXX_OPT = -g -ffreestanding -fno-exceptions -fno-rtti -nostdinc -nostdlib
|
||||
CXX_OPT = -g -ffreestanding -fPIC -fno-exceptions -fno-rtti -nostdinc -nostdlib -MMD
|
||||
|
||||
LD_SCRIPT= $(PRG_DIR)/../policy.ld
|
||||
|
||||
@ -23,7 +23,8 @@ policy.o: policy.cc
|
||||
|
||||
$(TARGET_POLICY).elf: table.o policy.o
|
||||
$(MSG_LINK)$@
|
||||
$(VERBOSE)$(LD) $(LD_MARCH) -T $(LD_SCRIPT) -Ttext=0 $^ -o $@
|
||||
$(VERBOSE)$(LD) $(LD_MARCH) -T $(LD_SCRIPT) -Ttext=0 \
|
||||
$^ $(shell $(CXX) $(CC_MARCH) -print-libgcc-file-name) -o $@
|
||||
|
||||
$(INSTALL_DIR)/$(TARGET_POLICY): $(TARGET_POLICY).elf
|
||||
$(VERBOSE)$(OBJCOPY) -O binary $< $@
|
||||
|
@ -2,9 +2,12 @@ PHDRS { rw PT_LOAD; }
|
||||
SECTIONS {
|
||||
|
||||
.text : {
|
||||
*(.data) /* must be first because it contains policy module header */
|
||||
*(.data.rel) /* must be first because it contains policy module header */
|
||||
*(.data)
|
||||
*(.rodata .rodata.*)
|
||||
*(.text .text.*)
|
||||
*(.bss)
|
||||
*(.got.plt)
|
||||
} : rw
|
||||
|
||||
/DISCARD/ : { *(.*) }
|
||||
|
Loading…
Reference in New Issue
Block a user