Created
April 4, 2011 16:58
-
-
Save mkrautz/901976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r f782663275a7 src/cmd/ld/macho.c | |
--- a/src/cmd/ld/macho.c Fri Apr 01 20:51:55 2011 -0700 | |
+++ b/src/cmd/ld/macho.c Mon Apr 04 18:57:07 2011 +0200 | |
@@ -306,7 +306,7 @@ | |
/* text */ | |
v = rnd(HEADR+segtext.len, INITRND); | |
- ms = newMachoSeg("__TEXT", 2); | |
+ ms = newMachoSeg("__TEXT", 3); | |
ms->vaddr = va; | |
ms->vsize = v; | |
ms->filesize = v; | |
@@ -318,17 +318,12 @@ | |
msect->size = segtext.sect->len; | |
msect->off = INITTEXT - va; | |
msect->flag = 0x400; /* flag - some instructions */ | |
- | |
- s = lookup(".plt", 0); | |
- if(s->size > 0) { | |
- msect = newMachoSect(ms, "__symbol_stub1"); | |
- msect->addr = symaddr(s); | |
- msect->size = s->size; | |
- msect->off = ms->fileoffset + msect->addr - ms->vaddr; | |
- msect->flag = 0x80000408; /* flag */ | |
- msect->res1 = 0; /* index into indirect symbol table */ | |
- msect->res2 = 6; /* size of stubs */ | |
- } | |
+ | |
+ msect = newMachoSect(ms, "__rodata"); | |
+ msect->addr = segtext.sect->next->vaddr; | |
+ msect->off = ms->fileoffset + msect->addr - ms->vaddr; | |
+ msect->size = segtext.sect->next->len; | |
+ msect->flag = 0x000; | |
/* data */ | |
w = segdata.len; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment