Thu Jan 14 11:58:32 2010 UTC ()
Wrap a few long lines.


(skrll)
diff -r1.35 -r1.36 src/libexec/ld.elf_so/arch/alpha/alpha_reloc.c
diff -r1.30 -r1.31 src/libexec/ld.elf_so/arch/i386/mdreloc.c
diff -r1.25 -r1.26 src/libexec/ld.elf_so/arch/m68k/mdreloc.c

cvs diff -r1.35 -r1.36 src/libexec/ld.elf_so/arch/alpha/alpha_reloc.c (expand / switch to unified diff)

--- src/libexec/ld.elf_so/arch/alpha/alpha_reloc.c 2010/01/14 11:57:06 1.35
+++ src/libexec/ld.elf_so/arch/alpha/alpha_reloc.c 2010/01/14 11:58:31 1.36
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: alpha_reloc.c,v 1.35 2010/01/14 11:57:06 skrll Exp $ */ 1/* $NetBSD: alpha_reloc.c,v 1.36 2010/01/14 11:58:31 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wasabi Systems, Inc. 4 * Copyright (c) 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -52,27 +52,27 @@ @@ -52,27 +52,27 @@
52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 54 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 55 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64#ifndef lint 64#ifndef lint
65__RCSID("$NetBSD: alpha_reloc.c,v 1.35 2010/01/14 11:57:06 skrll Exp $"); 65__RCSID("$NetBSD: alpha_reloc.c,v 1.36 2010/01/14 11:58:31 skrll Exp $");
66#endif /* not lint */ 66#endif /* not lint */
67 67
68#include <sys/types.h> 68#include <sys/types.h>
69#include <sys/stat.h> 69#include <sys/stat.h>
70#include <string.h> 70#include <string.h>
71 71
72#include "rtld.h" 72#include "rtld.h"
73#include "debug.h" 73#include "debug.h"
74 74
75#ifdef RTLD_DEBUG_ALPHA 75#ifdef RTLD_DEBUG_ALPHA
76#define adbg(x) xprintf x 76#define adbg(x) xprintf x
77#else 77#else
78#define adbg(x) /* nothing */ 78#define adbg(x) /* nothing */
@@ -290,27 +290,28 @@ _rtld_relocate_plt_lazy(const Obj_Entry  @@ -290,27 +290,28 @@ _rtld_relocate_plt_lazy(const Obj_Entry
290 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); 290 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
291 291
292 assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JMP_SLOT)); 292 assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JMP_SLOT));
293 293
294 /* Just relocate the GOT slots pointing into the PLT */ 294 /* Just relocate the GOT slots pointing into the PLT */
295 *where += (Elf_Addr)obj->relocbase; 295 *where += (Elf_Addr)obj->relocbase;
296 rdbg(("fixup !main in %s --> %p", obj->path, (void *)*where)); 296 rdbg(("fixup !main in %s --> %p", obj->path, (void *)*where));
297 } 297 }
298 298
299 return 0; 299 return 0;
300} 300}
301 301
302static inline int 302static inline int
303_rtld_relocate_plt_object(const Obj_Entry *obj, const Elf_Rela *rela, Elf_Addr *tp) 303_rtld_relocate_plt_object(const Obj_Entry *obj, const Elf_Rela *rela,
 304 Elf_Addr *tp)
304{ 305{
305 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); 306 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
306 Elf_Addr new_value; 307 Elf_Addr new_value;
307 const Elf_Sym *def; 308 const Elf_Sym *def;
308 const Obj_Entry *defobj; 309 const Obj_Entry *defobj;
309 Elf_Addr stubaddr;  310 Elf_Addr stubaddr;
310 unsigned long info = rela->r_info; 311 unsigned long info = rela->r_info;
311 312
312 assert(ELF_R_TYPE(info) == R_TYPE(JMP_SLOT)); 313 assert(ELF_R_TYPE(info) == R_TYPE(JMP_SLOT));
313 314
314 def = _rtld_find_plt_symdef(ELF_R_SYM(info), obj, &defobj, tp != NULL); 315 def = _rtld_find_plt_symdef(ELF_R_SYM(info), obj, &defobj, tp != NULL);
315 if (__predict_false(def == NULL)) 316 if (__predict_false(def == NULL))
316 return -1; 317 return -1;

cvs diff -r1.30 -r1.31 src/libexec/ld.elf_so/arch/i386/mdreloc.c (expand / switch to unified diff)

--- src/libexec/ld.elf_so/arch/i386/mdreloc.c 2010/01/13 22:34:07 1.30
+++ src/libexec/ld.elf_so/arch/i386/mdreloc.c 2010/01/14 11:58:32 1.31
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1/* $NetBSD: mdreloc.c,v 1.30 2010/01/13 22:34:07 skrll Exp $ */ 1/* $NetBSD: mdreloc.c,v 1.31 2010/01/14 11:58:32 skrll Exp $ */
2 2
3#include <sys/cdefs.h> 3#include <sys/cdefs.h>
4#ifndef lint 4#ifndef lint
5__RCSID("$NetBSD: mdreloc.c,v 1.30 2010/01/13 22:34:07 skrll Exp $"); 5__RCSID("$NetBSD: mdreloc.c,v 1.31 2010/01/14 11:58:32 skrll Exp $");
6#endif /* not lint */ 6#endif /* not lint */
7 7
8#include <sys/types.h> 8#include <sys/types.h>
9#include <sys/stat.h> 9#include <sys/stat.h>
10 10
11#include "debug.h" 11#include "debug.h"
12#include "rtld.h" 12#include "rtld.h"
13 13
14void _rtld_bind_start(void); 14void _rtld_bind_start(void);
15void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr); 15void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
16caddr_t _rtld_bind(const Obj_Entry *, Elf_Word); 16caddr_t _rtld_bind(const Obj_Entry *, Elf_Word);
17 17
18void 18void
@@ -178,27 +178,28 @@ _rtld_relocate_plt_object(const Obj_Entr @@ -178,27 +178,28 @@ _rtld_relocate_plt_object(const Obj_Entr
178 rdbg(("bind now/fixup in %s --> old=%p new=%p", 178 rdbg(("bind now/fixup in %s --> old=%p new=%p",
179 defobj->strtab + def->st_name, (void *)*where,  179 defobj->strtab + def->st_name, (void *)*where,
180 (void *)target)); 180 (void *)target));
181 if (*where != target) 181 if (*where != target)
182 *where = target; 182 *where = target;
183 if (tp) 183 if (tp)
184 *tp = target; 184 *tp = target;
185 return 0; 185 return 0;
186} 186}
187 187
188caddr_t 188caddr_t
189_rtld_bind(const Obj_Entry *obj, Elf_Word reloff) 189_rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
190{ 190{
191 const Elf_Rel *rel = (const Elf_Rel *)((const uint8_t *)obj->pltrel + reloff); 191 const Elf_Rel *rel = (const Elf_Rel *)((const uint8_t *)obj->pltrel
 192 + reloff);
192 Elf_Addr new_value; 193 Elf_Addr new_value;
193 int err; 194 int err;
194 195
195 new_value = 0; /* XXX gcc */ 196 new_value = 0; /* XXX gcc */
196 197
197 err = _rtld_relocate_plt_object(obj, rel, &new_value); 198 err = _rtld_relocate_plt_object(obj, rel, &new_value);
198 if (err) 199 if (err)
199 _rtld_die(); 200 _rtld_die();
200 201
201 return (caddr_t)new_value; 202 return (caddr_t)new_value;
202} 203}
203 204
204int 205int

cvs diff -r1.25 -r1.26 src/libexec/ld.elf_so/arch/m68k/mdreloc.c (expand / switch to unified diff)

--- src/libexec/ld.elf_so/arch/m68k/mdreloc.c 2010/01/13 20:17:22 1.25
+++ src/libexec/ld.elf_so/arch/m68k/mdreloc.c 2010/01/14 11:58:32 1.26
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: mdreloc.c,v 1.25 2010/01/13 20:17:22 christos Exp $ */ 1/* $NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $ */
2 2
3#include <sys/cdefs.h> 3#include <sys/cdefs.h>
4#ifndef lint 4#ifndef lint
5__RCSID("$NetBSD: mdreloc.c,v 1.25 2010/01/13 20:17:22 christos Exp $"); 5__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $");
6#endif /* not lint */ 6#endif /* not lint */
7 7
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#ifndef lint 9#ifndef lint
10__RCSID("$NetBSD: mdreloc.c,v 1.25 2010/01/13 20:17:22 christos Exp $"); 10__RCSID("$NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $");
11#endif /* not lint */ 11#endif /* not lint */
12 12
13#include <sys/types.h> 13#include <sys/types.h>
14#include <sys/stat.h> 14#include <sys/stat.h>
15 15
16#include "debug.h" 16#include "debug.h"
17#include "rtld.h" 17#include "rtld.h"
18 18
19void _rtld_bind_start(void); 19void _rtld_bind_start(void);
20void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr); 20void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
21caddr_t _rtld_bind(const Obj_Entry *, Elf_Word); 21caddr_t _rtld_bind(const Obj_Entry *, Elf_Word);
22static inline int _rtld_relocate_plt_object(const Obj_Entry *, 22static inline int _rtld_relocate_plt_object(const Obj_Entry *,
23 const Elf_Rela *, Elf_Addr *); 23 const Elf_Rela *, Elf_Addr *);
@@ -155,27 +155,28 @@ _rtld_relocate_plt_lazy(const Obj_Entry  @@ -155,27 +155,28 @@ _rtld_relocate_plt_lazy(const Obj_Entry
155 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); 155 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
156 156
157 assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JMP_SLOT)); 157 assert(ELF_R_TYPE(rela->r_info) == R_TYPE(JMP_SLOT));
158 158
159 /* Just relocate the GOT slots pointing into the PLT */ 159 /* Just relocate the GOT slots pointing into the PLT */
160 *where += (Elf_Addr)obj->relocbase; 160 *where += (Elf_Addr)obj->relocbase;
161 rdbg(("fixup !main in %s --> %p", obj->path, (void *)*where)); 161 rdbg(("fixup !main in %s --> %p", obj->path, (void *)*where));
162 } 162 }
163 163
164 return 0; 164 return 0;
165} 165}
166 166
167static inline int 167static inline int
168_rtld_relocate_plt_object(const Obj_Entry *obj, const Elf_Rela *rela, Elf_Addr *tp) 168_rtld_relocate_plt_object(const Obj_Entry *obj, const Elf_Rela *rela,
 169 Elf_Addr *tp)
169{ 170{
170 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset); 171 Elf_Addr *where = (Elf_Addr *)(obj->relocbase + rela->r_offset);
171 Elf_Addr new_value; 172 Elf_Addr new_value;
172 const Elf_Sym *def; 173 const Elf_Sym *def;
173 const Obj_Entry *defobj; 174 const Obj_Entry *defobj;
174 unsigned long info = rela->r_info; 175 unsigned long info = rela->r_info;
175 176
176 assert(ELF_R_TYPE(info) == R_TYPE(JMP_SLOT)); 177 assert(ELF_R_TYPE(info) == R_TYPE(JMP_SLOT));
177 178
178 def = _rtld_find_plt_symdef(ELF_R_SYM(info), obj, &defobj, tp != NULL); 179 def = _rtld_find_plt_symdef(ELF_R_SYM(info), obj, &defobj, tp != NULL);
179 if (__predict_false(def == NULL)) 180 if (__predict_false(def == NULL))
180 return -1; 181 return -1;
181 if (__predict_false(def == &_rtld_sym_zero)) 182 if (__predict_false(def == &_rtld_sym_zero))