[PATCH] pie: Fix pie.lds.S.in script to work with the gold linker

Saied Kazemi saied at google.com
Mon Mar 10 23:36:07 PDT 2014


The pie.lds.S.in needs two minor changes to work with the gold (/usr/bin/gold)
linker. These changes are compatible with /usr/bin/ld and make linker script
more portable.

The first change is adding a comma before /DISCARD/ so that the grammar
won't be ambiguous. A Otherwise, gold treats it as a part of the assignment
and would generate a syntax error about the "unexpected ':'".

The second change is moving initialization of __export_parasite_args
to inside the SECTIONS command because it references the dot symbol.
Otherwise, gold would generate the error "invalid reference to dot
symbol outside of SECTIONS clause.

Signed-off-by: Saied Kazemi <saied at google.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/pie.lds.S.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pie/pie.lds.S.in b/pie/pie.lds.S.in
index cbdfaa92bc84..f1dc526ef762 100644
--- a/pie/pie.lds.S.in
+++ b/pie/pie.lds.S.in
@@ -12,7 +12,7 @@ SECTIONS
 		. = ALIGN(32);
 		*(.got*)
 		. = ALIGN(32);
-	} =0x00000000
+	} =0x00000000,
 
 	/DISCARD/ : {
 		*(.debug*)
@@ -22,6 +22,6 @@ SECTIONS
 		*(.eh_frame*)
 		*(*)
 	}
-}
 
 __export_parasite_args = .;
+}
-- 
1.8.3.1


--OzxllxdKGCiKxUZM--


More information about the CRIU mailing list