Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(453)

Unified Diff: src/cmd/dist/buildruntime.c

Issue 7891047: code review 7891047: cmd/ld: emit TLS relocations during external linking (Closed)
Patch Set: diff -r 43052d8c5ebf https://code.google.com/p/go Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cmd/8l/span.c ('k') | src/cmd/ld/data.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cmd/dist/buildruntime.c
===================================================================
--- a/src/cmd/dist/buildruntime.c
+++ b/src/cmd/dist/buildruntime.c
@@ -133,12 +133,17 @@
"// which is where these macros come into play.\n"
"// get_tls sets up the temporary and then g and r use it.\n"
"//\n"
- "// The final wrinkle is that get_tls needs to read from %gs:0,\n"
+ "// Another wrinkle is that get_tls needs to read from %gs:0,\n"
"// but in 8l input it's called 8(GS), because 8l is going to\n"
"// subtract 8 from all the offsets, as described above.\n"
+ "//\n"
+ "// The final wrinkle is that when generating an ELF .o file for\n"
+ "// external linking mode, we need to be able to relocate the\n"
+ "// -8(r) and -4(r) instructions. Tag them with an extra (GS*1)\n"
+ "// that is ignored by the linker except for that identification.\n"
"#define get_tls(r) MOVL 8(GS), r\n"
- "#define g(r) -8(r)\n"
- "#define m(r) -4(r)\n"
+ "#define g(r) -8(r)(GS*1)\n"
+ "#define m(r) -4(r)(GS*1)\n"
},
{"386", "",
"#define get_tls(r)\n"
« no previous file with comments | « src/cmd/8l/span.c ('k') | src/cmd/ld/data.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b