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

Side by Side Diff: src/cmd/ld/elf.c

Issue 106380043: code review 106380043: cmd/go, cmd/ld, runtime, os/user: TLS emultion for android (Closed)
Patch Set: diff -r 86b431eeb5c2 https://code.google.com/p/go Created 11 years, 5 months ago
Left:
Right:
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 unified diff | Download patch
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #include "l.h" 5 #include "l.h"
6 #include "lib.h" 6 #include "lib.h"
7 #include "../ld/elf.h" 7 #include "../ld/elf.h"
8 8
9 /* 9 /*
10 * We use the 64-bit data structures on both 32- and 64-bit machines 10 * We use the 64-bit data structures on both 32- and 64-bit machines
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 if(sect->vaddr < sect->seg->vaddr + sect->seg->filelen) 769 if(sect->vaddr < sect->seg->vaddr + sect->seg->filelen)
770 sh->type = SHT_PROGBITS; 770 sh->type = SHT_PROGBITS;
771 else 771 else
772 sh->type = SHT_NOBITS; 772 sh->type = SHT_NOBITS;
773 sh->flags = SHF_ALLOC; 773 sh->flags = SHF_ALLOC;
774 if(sect->rwx & 1) 774 if(sect->rwx & 1)
775 sh->flags |= SHF_EXECINSTR; 775 sh->flags |= SHF_EXECINSTR;
776 if(sect->rwx & 2) 776 if(sect->rwx & 2)
777 sh->flags |= SHF_WRITE; 777 sh->flags |= SHF_WRITE;
778 if(strcmp(sect->name, ".tbss") == 0) { 778 if(strcmp(sect->name, ".tbss") == 0) {
779 » » sh->flags |= SHF_TLS; 779 » » if(strcmp(goos, "android") != 0)
dave_cheney.net 2014/07/02 04:33:05 can you use (HEADTYPE == Handroid) here ?
crawshaw 2014/07/02 14:57:21 Confusingly, there is no Handroid. I mapped goos o
780 » » » sh->flags |= SHF_TLS; // no TLS on android
780 sh->type = SHT_NOBITS; 781 sh->type = SHT_NOBITS;
781 } 782 }
782 if(linkmode != LinkExternal) 783 if(linkmode != LinkExternal)
783 sh->addr = sect->vaddr; 784 sh->addr = sect->vaddr;
784 sh->addralign = sect->align; 785 sh->addralign = sect->align;
785 sh->size = sect->len; 786 sh->size = sect->len;
786 sh->off = sect->seg->fileoff + sect->vaddr - sect->seg->vaddr; 787 sh->off = sect->seg->fileoff + sect->vaddr - sect->seg->vaddr;
787 788
788 return sh; 789 return sh;
789 } 790 }
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1516 if(HEADTYPE == Hnetbsd) 1517 if(HEADTYPE == Hnetbsd)
1517 a += elfwritenetbsdsig(); 1518 a += elfwritenetbsdsig();
1518 if(HEADTYPE == Hopenbsd) 1519 if(HEADTYPE == Hopenbsd)
1519 a += elfwriteopenbsdsig(); 1520 a += elfwriteopenbsdsig();
1520 if(buildinfolen > 0) 1521 if(buildinfolen > 0)
1521 a += elfwritebuildinfo(); 1522 a += elfwritebuildinfo();
1522 } 1523 }
1523 if(a > ELFRESERVE)······ 1524 if(a > ELFRESERVE)······
1524 diag("ELFRESERVE too small: %lld > %d", a, ELFRESERVE); 1525 diag("ELFRESERVE too small: %lld > %d", a, ELFRESERVE);
1525 } 1526 }
OLDNEW

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