LEFT | RIGHT |
(no file at all) | |
1 // Inferno utils/8l/asm.c | 1 // Inferno utils/8l/asm.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/asm.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/8l/asm.c |
3 // | 3 // |
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
6 // Portions Copyright © 1997-1999 Vita Nuova Limited | 6 // Portions Copyright © 1997-1999 Vita Nuova Limited |
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
8 // Portions Copyright © 2004,2006 Bruce Ellis | 8 // Portions Copyright © 2004,2006 Bruce Ellis |
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others | 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 s->type = 100; // avoid SDATA, etc. | 87 s->type = 100; // avoid SDATA, etc. |
88 return 1; | 88 return 1; |
89 } | 89 } |
90 return 0; | 90 return 0; |
91 } | 91 } |
92 | 92 |
93 int nelfsym = 1; | 93 int nelfsym = 1; |
94 | 94 |
95 static void addpltsym(Sym*); | 95 static void addpltsym(Sym*); |
96 static void addgotsym(Sym*); | 96 static void addgotsym(Sym*); |
| 97 |
| 98 Sym * |
| 99 lookuprel(void) |
| 100 { |
| 101 return lookup(".rel", 0); |
| 102 } |
| 103 |
| 104 void |
| 105 adddynrela(Sym *rela, Sym *s, Reloc *r) |
| 106 { |
| 107 sysfatal("adddynrela not implemented"); |
| 108 } |
97 | 109 |
98 void | 110 void |
99 adddynrel(Sym *s, Reloc *r) | 111 adddynrel(Sym *s, Reloc *r) |
100 { | 112 { |
101 Sym *targ, *rel, *got; | 113 Sym *targ, *rel, *got; |
102 | 114 |
103 targ = r->sym; | 115 targ = r->sym; |
104 cursym = s; | 116 cursym = s; |
105 | 117 |
106 switch(r->type) { | 118 switch(r->type) { |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 | 820 |
809 if(r <= 0) | 821 if(r <= 0) |
810 return v; | 822 return v; |
811 v += r - 1; | 823 v += r - 1; |
812 c = v % r; | 824 c = v % r; |
813 if(c < 0) | 825 if(c < 0) |
814 c += r; | 826 c += r; |
815 v -= c; | 827 v -= c; |
816 return v; | 828 return v; |
817 } | 829 } |
LEFT | RIGHT |