Hi,

adding support for partial linking broke linking on systems where PIE is default. The linker will give you the following error:

/usr/bin/ld: -r and -pie may not be used together

In my case changing the gcc parameter from '-Wl,--relocatable' to '-r' solved the problem. With that gcc does not pass the -r flag to the linker if PIE is enabled.
Diff is attached.

Cheers,
Matthias

diff --git a/SConstruct b/SConstruct
index 84a0a98ed..7edcc4935 100755
--- a/SConstruct
+++ b/SConstruct
@@ -692,7 +692,7 @@ if main['GCC'] or main['CLANG']:
     main['FILTER_PSHLINKFLAGS'] = lambda x: str(x).replace(' -shared', '')
     main['PSHLINKFLAGS'] = main.subst('${FILTER_PSHLINKFLAGS(SHLINKFLAGS)}')
     main['PLINKFLAGS'] = main.subst('${LINKFLAGS}')
-    shared_partial_flags = ['-Wl,--relocatable', '-nostdlib']
+    shared_partial_flags = ['-r', '-nostdlib']
     main.Append(PSHLINKFLAGS=shared_partial_flags)
     main.Append(PLINKFLAGS=shared_partial_flags)
 else:

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to