author | yiluzhu |
Fri, 15 Jan 2010 11:38:40 +0000 | |
branch | fix |
changeset 110 | 6d26dad20418 |
parent 50 | 16660b95a7bf |
permissions | -rw-r--r-- |
3 | 1 |
# |
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
# All rights reserved. |
|
4 |
# This component and the accompanying materials are made available |
|
5 |
# under the terms of the License "Eclipse Public License v1.0" |
|
6 |
# which accompanies this distribution, and is available |
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
# |
|
9 |
# Initial Contributors: |
|
10 |
# Nokia Corporation - initial contribution. |
|
11 |
# |
|
12 |
# Contributors: |
|
13 |
# |
|
14 |
# Description: |
|
15 |
# ARMv5 e32 postlinking FLM |
|
16 |
# Knows how to postlink all possible ABIV2 executables for ARM |
|
17 |
# |
|
18 |
||
19 |
# Interface |
|
20 |
# |
|
21 |
# Metadata supplied (or deduced from) |
|
22 |
# |
|
9 | 23 |
# ARMFPU |
24 |
# BYTEPAIRCOMPRESSTARGET |
|
3 | 25 |
# CAPABILITY |
9 | 26 |
# COMPRESSTARGET Not directly referenced, at least with the current approach to compression keywords |
27 |
# DEBUGGABLE Can be "udeb" or "urel" or "udeb urel" or "" |
|
3 | 28 |
# E32TARGET |
29 |
# EPOCALLOWDLLDATA |
|
30 |
# EPOCFIXEDPROCESS |
|
31 |
# EPOCHEAPSIZEMAX |
|
32 |
# EPOCHEAPSIZEMIN |
|
33 |
# EPOCPROCESSPRIORITY |
|
34 |
# EPOCSTACKSIZE |
|
35 |
# EXPORTUNFROZEN |
|
9 | 36 |
# INFLATECOMPRESSTARGET |
37 |
# NOCOMPRESSTARGET |
|
3 | 38 |
# POSTLINKTARGETTYPE |
39 |
# SID |
|
40 |
# SMPSAFE |
|
41 |
# UID2 |
|
42 |
# UID3 |
|
43 |
# VERSION |
|
44 |
# VENDORID |
|
45 |
# |
|
46 |
# Other |
|
47 |
# |
|
48 |
# ARMLIBS |
|
9 | 49 |
# AUTOEXPORTS Symbols that must be assumed to exist for this TARGETTYPE in the format: export,ordinal;export,ordinal;.. |
50 |
# CANIGNORENONCALLABLE If the TARGETTYPE allows it, disregard non-callable exports (v-tables, type information, etc.) |
|
3 | 51 |
# CANHAVEEXPORTS |
52 |
# CLEANTARGETS |
|
53 |
# ELF2E32 |
|
9 | 54 |
# EPOCDATALINKADDRESS Redundant? |
3 | 55 |
# EPOCROOT |
56 |
# EXPTARGET |
|
57 |
# GENERATED_DEFFILE |
|
58 |
# GENERATED_DSO |
|
59 |
# HAVE_ORDERONLY |
|
60 |
# IMPORTLIBRARYREQUIRED |
|
61 |
# INTERMEDIATEPATH |
|
62 |
# LINKASVERSIONED |
|
9 | 63 |
# LINK_TARGET Postlinker elf input |
3 | 64 |
# NAMEDSYMLKUP |
65 |
# PAGEDCODE_OPTION |
|
66 |
# POSTLINKDEFFILE |
|
9 | 67 |
# POSTLINKER_COMPRESSION_DEFAULT Default compression when either COMPRESSTARGET or no compression .mmp keyword is used |
68 |
# POSTLINKER_FPU_DEFAULT |
|
3 | 69 |
# POSTLINKER_SUPPORTS_WDP |
70 |
# RUNTIME_LIBS_PATH |
|
71 |
# SAVESPACE |
|
72 |
# STATIC_LIBS_PATH |
|
73 |
# UID1 |
|
74 |
# VARIANTTYPE |
|
75 |
||
76 |
||
77 |
# Capabilities |
|
78 |
ADDED_CAPABILITIES:=$(subst $(CHAR_SPACE),+,$(filter-out -%,$(CAPABILITY))) |
|
79 |
SUBTRACTED_CAPABILITIES:=$(subst $(CHAR_SPACE),,$(filter -%,$(CAPABILITY))) |
|
80 |
FINAL_CAPABILITIES:=$(if $(ADDED_CAPABILITIES),$(ADDED_CAPABILITIES)$(SUBTRACTED_CAPABILITIES),NONE) |
|
81 |
||
82 |
# Paging options for the old postlinker |
|
83 |
POSTLINKER_PAGEDOPTION:=--defaultpaged |
|
84 |
ifeq ($(PAGED),1) |
|
85 |
POSTLINKER_PAGEDOPTION:=--paged |
|
86 |
endif |
|
87 |
ifeq ($(PAGED),0) |
|
50
16660b95a7bf
single character fix for --unpaged
Richard Taylor <richard.i.taylor@nokia.com>
parents:
39
diff
changeset
|
88 |
POSTLINKER_PAGEDOPTION:=--unpaged |
3 | 89 |
endif |
90 |
||
91 |
# Postlink target |
|
92 |
define e32postlink |
|
93 |
$(E32TARGET): $(LINK_TARGET) $(POSTLINKDEFFILE) $(ELF2E32) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB |
|
94 |
$(call startrule,postlink) \ |
|
95 |
$(ELF2E32) \ |
|
96 |
--sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \ |
|
97 |
--version=$(VERSION) \ |
|
98 |
--capability=$(FINAL_CAPABILITIES) \ |
|
99 |
--linkas=$(call dblquote,$(LINKASVERSIONED)) \ |
|
9 | 100 |
--fpu=$(if $(ARMFPU),$(ARMFPU),$(POSTLINKER_FPU_DEFAULT)) \ |
3 | 101 |
--targettype=$(POSTLINKTARGETTYPE) \ |
102 |
--output=$$(call dblquote,$$@) \ |
|
103 |
--elfinput=$(call dblquote,$(LINK_TARGET)) \ |
|
104 |
$(if $(UID1),--uid1=0x$(UID1),) \ |
|
105 |
$(if $(UID2),--uid2=0x$(UID2),) \ |
|
106 |
$(if $(UID3),--uid3=0x$(UID3),) \ |
|
107 |
$(if $(VENDORID),--vid=0x$(VENDORID),) \ |
|
108 |
$(if $(EXPTARGET),--customdlltarget,) \ |
|
109 |
$(if $(ARMLIBS),--excludeunwantedexports,) \ |
|
110 |
$(if $(EPOCALLOWDLLDATA),--dlldata,) \ |
|
111 |
$(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \ |
|
112 |
$(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \ |
|
113 |
$(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \ |
|
114 |
$(if $(EPOCFIXEDPROCESS),--fixedaddress,) \ |
|
115 |
$(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \ |
|
116 |
$(if $(NAMEDSYMLKUP),--namedlookup,) \ |
|
117 |
$(if $(SMPSAFE),--smpsafe,) \ |
|
118 |
$(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \ |
|
119 |
$(if $(EXPORTUNFROZEN),--unfrozen,) \ |
|
120 |
$(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \ |
|
121 |
$(if $(CANIGNORENONCALLABLE), \ |
|
122 |
$(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \ |
|
123 |
$(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \ |
|
124 |
$(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \ |
|
125 |
$(if $(POSTLINKER_SUPPORTS_WDP), \ |
|
126 |
--codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \ |
|
127 |
$(POSTLINKER_PAGEDOPTION)) \ |
|
9 | 128 |
$(if $(NOCOMPRESSTARGET),--uncompressed, \ |
129 |
$(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \ |
|
130 |
$(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \ |
|
131 |
--compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \ |
|
3 | 132 |
--libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \ |
9 | 133 |
$(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,&& { $(GNURM) -rf $(INTERMEDIATEPATH); true; })) \ |
3 | 134 |
$(call endrule,postlink) |
135 |
endef |
|
136 |
$(eval $(e32postlink)) |
|
137 |
||
138 |
CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET) |
|
139 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE) |
|
140 |
CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO) |