Skip to content

Commit

Permalink
[build] Don't use rodso.ld with lld
Browse files Browse the repository at this point in the history
With lld's -z rodynamic, it's now possible to do the "rodso" cases (the
vDSO and userboot) without using the scripts/rodso.ld linker script.

Change-Id: I30cb10a23e71878f524f04f30c4834c108c90efd
  • Loading branch information
frobtech committed Sep 9, 2017
1 parent 4cb8b12 commit 25156ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions make/engine.mk
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ USER_LDFLAGS := \

ifeq ($(call TOBOOL,$(USE_LLD)),true)
USER_LDFLAGS += -z rodynamic
RODSO_LDFLAGS :=
else
RODSO_LDFLAGS := -T scripts/rodso.ld
endif

ifeq ($(call TOBOOL,$(USE_LTO)),true)
Expand Down
2 changes: 1 addition & 1 deletion system/core/userboot/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ GENERATED += $(BUILDDIR)/$(LOCAL_DIR)/vdso-syms.ld.h
MODULE_EXTRA_OBJS := $(BUILDDIR)/$(LOCAL_DIR)/vdso-syms.ld

# userboot is a reentrant DSO (no writable segment) with an entry point.
MODULE_LDFLAGS := -T scripts/rodso.ld -e _start
MODULE_LDFLAGS := $(RODSO_LDFLAGS) -e _start

include make/module.mk
2 changes: 1 addition & 1 deletion system/ulib/magenta/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ MODULE_SO_INSTALL_NAME := -
# All the code this DSO is pure read-only/reentrant code that
# does not need any writable data (except its caller's stack).
# Make it use a simplified, hardened memory layout.
MODULE_LDFLAGS := -T scripts/rodso.ld
MODULE_LDFLAGS := $(RODSO_LDFLAGS)

# Explicit dependency to make sure the file gets generated first.
# MODULE_SRCDEPS is overkill for this since only one file uses it.
Expand Down

0 comments on commit 25156ee

Please sign in to comment.