Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: pnacl/driver/pnacl-translate.py

Issue 352213002: PNaCl dynamic loading: Extend pnacl-translate to be able to translate PSOs (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Cleanup Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pnacl/build.sh ('k') | site_scons/site_tools/naclsdk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pnacl/driver/pnacl-translate.py
diff --git a/pnacl/driver/pnacl-translate.py b/pnacl/driver/pnacl-translate.py
index 3953755f371e205642ea865e27f560b0094b276d..659454fc1d3f76b0c4bbab71bb10777730eab56e 100755
--- a/pnacl/driver/pnacl-translate.py
+++ b/pnacl/driver/pnacl-translate.py
@@ -22,7 +22,8 @@ from driver_temps import TempFiles
import subprocess
EXTRA_ENV = {
- 'PIC': '${NONSFI_NACL}',
+ 'TRANSLATE_PSO': '0',
+ 'PIC': '${NONSFI_NACL || TRANSLATE_PSO ? 1 : 0}',
# Determine if we should build nexes compatible with the IRT
'USE_IRT' : '1',
@@ -69,9 +70,11 @@ EXTRA_ENV = {
# the pexe, however for the IRT it comes from irt_entry.c and when linking it
# using native object files, this reference is required to make sure it gets
# pulled in from the archive.
- 'LD_ARGS_ENTRY': '${NONSFI_NACL && !USE_IRT '
- ' ? --entry=__pnacl_start_linux : --entry=__pnacl_start} '
- '--undefined=_start',
+ 'LD_ARGS_ENTRY':
+ '${TRANSLATE_PSO ? --entry=__pnacl_pso_root : '
+ ' ${NONSFI_NACL && !USE_IRT '
+ ' ? --entry=__pnacl_start_linux : --entry=__pnacl_start} '
+ ' --undefined=_start}',
'CRTBEGIN': '${ALLOW_ZEROCOST_CXX_EH ? -l:crtbegin_for_eh.o : -l:crtbegin.o}',
'CRTEND': '-l:crtend.o',
@@ -80,7 +83,8 @@ EXTRA_ENV = {
# These are just the dependencies in the native link.
'LD_ARGS_normal':
- '${CRTBEGIN} ${ld_inputs} ' +
+ '${!TRANSLATE_PSO ? ${CRTBEGIN}} ' +
+ '${ld_inputs} ' +
'${USE_IRT_SHIM ? ${LD_ARGS_IRT_SHIM} : ${LD_ARGS_IRT_SHIM_DUMMY}} ' +
'--start-group ' +
'${USE_DEFAULTLIBS ? ${DEFAULTLIBS}} ' +
@@ -145,6 +149,8 @@ TranslatorPatterns = [
( '-o(.+)', "env.set('OUTPUT', pathtools.normalize($0))"),
( ('-o', '(.+)'), "env.set('OUTPUT', pathtools.normalize($0))"),
+ ( '-pso', "env.set('TRANSLATE_PSO', '1')"),
+
( '-S', "env.set('OUTPUT_TYPE', 's')"), # Stop at .s
( '-c', "env.set('OUTPUT_TYPE', 'o')"), # Stop at .o
@@ -260,6 +266,13 @@ def SetUpArch():
def SetUpLinkOptions():
+ if env.getbool('TRANSLATE_PSO'):
+ # Using "-pie" rather than "-shared" has the effect of suppressing the
+ # creation of a PLT and R_*_JUMP_SLOT relocations, which come from the
+ # external symbol references that multi-threaded translation produces.
+ env.append('LD_FLAGS', '-pie')
+ return
+
if env.getbool('NONSFI_NACL'):
# "_begin" allows a PIE to find its load address in order to apply
# dynamic relocations.
« no previous file with comments | « pnacl/build.sh ('k') | site_scons/site_tools/naclsdk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698