diff options
-rw-r--r-- | trunk/ChangeLog | 27 | ||||
-rw-r--r-- | trunk/src/arch-alpha.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-arm.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-cris.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-i386.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-ia64.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-mips.c | 1 | ||||
-rw-r--r-- | trunk/src/arch-ppc.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-ppc64.c | 8 | ||||
-rw-r--r-- | trunk/src/arch-s390.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-s390x.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-sh.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-sparc.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-sparc64.c | 3 | ||||
-rw-r--r-- | trunk/src/arch-x86_64.c | 3 | ||||
-rw-r--r-- | trunk/src/cxx.c | 11 | ||||
-rw-r--r-- | trunk/src/get.c | 16 | ||||
-rw-r--r-- | trunk/src/prelink.h | 4 |
18 files changed, 79 insertions, 24 deletions
diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 612614e..d743677 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,30 @@ +2009-03-11 Jakub Jelinek <jakub@redhat.com> + + * src/prelink.h (PLArch): Add rtype_class_valid field. + * src/get.c (prelink_record_relocations): If not /4, or + dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID + into reloc_class. + * src/cxx.c (remove_redundant_cxx_conflicts): Use + info->dso->arch->rtype_class_valid instead of RTYPE_CLASS_VALID. + * src/arch-ppc64.c (ppc64_reloc_class): For R_PPC64_COPY return + RTYPE_CLASS_COPY | RTYPE_CLASS_PLT, for non-TLS relocs return + RTYPE_CLASS_PLT. + (PL_ARCH): Set rtype_class_valid to RTYPE_CLASS_PLT. + * src/arch-alpha.c (PL_ARCH): Set rtype_class_valid to + RTYPE_CLASS_VALID. + * src/arch-arm.c (PL_ARCH): Likewise. + * src/arch-cris.c (PL_ARCH): Likewise. + * src/arch-i386.c (PL_ARCH): Likewise. + * src/arch-ia64.c (PL_ARCH): Likewise. + * src/arch-mips.c (PL_ARCH): Likewise. + * src/arch-ppc.c (PL_ARCH): Likewise. + * src/arch-s390.c (PL_ARCH): Likewise. + * src/arch-s390x.c (PL_ARCH): Likewise. + * src/arch-sh.c (PL_ARCH): Likewise. + * src/arch-sparc.c (PL_ARCH): Likewise. + * src/arch-sparc64.c (PL_ARCH): Likewise. + * src/arch-x86_64.c (PL_ARCH): Likewise. + 2009-03-04 Joseph Myers <joseph@codesourcery.com> * testsuite/reloc2.sh, testsuite/tls3.sh: Add ARM to architectures diff --git a/trunk/src/arch-alpha.c b/trunk/src/arch-alpha.c index 51182ed..31b03ae 100644 --- a/trunk/src/arch-alpha.c +++ b/trunk/src/arch-alpha.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -467,6 +467,7 @@ PL_ARCH = { .R_JMP_SLOT = R_ALPHA_JMP_SLOT, .R_COPY = -1, .R_RELATIVE = R_ALPHA_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux.so.2", .adjust_dyn = alpha_adjust_dyn, .adjust_rel = alpha_adjust_rel, diff --git a/trunk/src/arch-arm.c b/trunk/src/arch-arm.c index a15244a..66d3ffb 100644 --- a/trunk/src/arch-arm.c +++ b/trunk/src/arch-arm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -817,6 +817,7 @@ PL_ARCH = { .R_JMP_SLOT = R_ARM_JUMP_SLOT, .R_COPY = R_ARM_COPY, .R_RELATIVE = R_ARM_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux.so.2", .adjust_dyn = arm_adjust_dyn, .adjust_rel = arm_adjust_rel, diff --git a/trunk/src/arch-cris.c b/trunk/src/arch-cris.c index 6b56016..43f987a 100644 --- a/trunk/src/arch-cris.c +++ b/trunk/src/arch-cris.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -375,6 +375,7 @@ PL_ARCH = { .R_JUMP_SLOT = R_CRIS_JUMP_SLOT, .R_COPY = R_CRIS_COPY, .R_RELATIVE = R_CRIS_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld.so.1", .adjust_dyn = cris_adjust_dyn, .adjust_rel = cris_adjust_rel, diff --git a/trunk/src/arch-i386.c b/trunk/src/arch-i386.c index d5211b2..34af1d2 100644 --- a/trunk/src/arch-i386.c +++ b/trunk/src/arch-i386.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -1052,6 +1052,7 @@ PL_ARCH = { .R_JMP_SLOT = R_386_JMP_SLOT, .R_COPY = R_386_COPY, .R_RELATIVE = R_386_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux.so.2", .adjust_dyn = i386_adjust_dyn, .adjust_rel = i386_adjust_rel, diff --git a/trunk/src/arch-ia64.c b/trunk/src/arch-ia64.c index 0be672c..bdfe1b1 100644 --- a/trunk/src/arch-ia64.c +++ b/trunk/src/arch-ia64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -493,6 +493,7 @@ PL_ARCH = { .R_JMP_SLOT = R_IA64_IPLTLSB, .R_COPY = -1, .R_RELATIVE = R_IA64_REL64LSB, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux-ia64.so.2", .adjust_dyn = ia64_adjust_dyn, .adjust_rel = ia64_adjust_rel, diff --git a/trunk/src/arch-mips.c b/trunk/src/arch-mips.c index f5a2361..4be23c8 100644 --- a/trunk/src/arch-mips.c +++ b/trunk/src/arch-mips.c @@ -999,6 +999,7 @@ PL_ARCH = { /* R_MIPS_REL32 relocations against symbol 0 do act as relative relocs, but those against other symbols don't. */ .R_RELATIVE = ~0U, + .rtype_class_valid = RTYPE_CLASS_VALID, .arch_adjust = mips_arch_adjust, .adjust_dyn = mips_adjust_dyn, .adjust_rel = mips_adjust_rel, diff --git a/trunk/src/arch-ppc.c b/trunk/src/arch-ppc.c index 5608750..24a22b9 100644 --- a/trunk/src/arch-ppc.c +++ b/trunk/src/arch-ppc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -1122,6 +1122,7 @@ PL_ARCH = { .R_JMP_SLOT = R_PPC_JMP_SLOT, .R_COPY = R_PPC_COPY, .R_RELATIVE = R_PPC_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld.so.1", .adjust_dyn = ppc_adjust_dyn, .adjust_rel = ppc_adjust_rel, diff --git a/trunk/src/arch-ppc64.c b/trunk/src/arch-ppc64.c index 3b12dbe..f0195d2 100644 --- a/trunk/src/arch-ppc64.c +++ b/trunk/src/arch-ppc64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2002. This program is free software; you can redistribute it and/or modify @@ -771,13 +771,12 @@ ppc64_reloc_class (int reloc_type) { switch (reloc_type) { - case R_PPC64_COPY: return RTYPE_CLASS_COPY; - case R_PPC64_ADDR24: return RTYPE_CLASS_PLT; + case R_PPC64_COPY: return RTYPE_CLASS_COPY | RTYPE_CLASS_PLT; default: if (reloc_type >= R_PPC64_DTPMOD64 && reloc_type <= R_PPC64_TPREL16_HIGHESTA) return RTYPE_CLASS_TLS; - return RTYPE_CLASS_VALID; + return RTYPE_CLASS_PLT; } } @@ -824,6 +823,7 @@ PL_ARCH = { .R_JMP_SLOT = R_PPC64_JMP_SLOT, .R_COPY = R_PPC64_COPY, .R_RELATIVE = R_PPC64_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_PLT, .dynamic_linker = "/lib64/ld64.so.1", .adjust_section = ppc64_adjust_section, .adjust_dyn = ppc64_adjust_dyn, diff --git a/trunk/src/arch-s390.c b/trunk/src/arch-s390.c index 4be0dcb..a0b33ba 100644 --- a/trunk/src/arch-s390.c +++ b/trunk/src/arch-s390.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -482,6 +482,7 @@ PL_ARCH = { .R_JMP_SLOT = R_390_JMP_SLOT, .R_COPY = R_390_COPY, .R_RELATIVE = R_390_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld.so.1", .adjust_dyn = s390_adjust_dyn, .adjust_rel = s390_adjust_rel, diff --git a/trunk/src/arch-s390x.c b/trunk/src/arch-s390x.c index 1e381c7..2027005 100644 --- a/trunk/src/arch-s390x.c +++ b/trunk/src/arch-s390x.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -598,6 +598,7 @@ PL_ARCH = { .R_JMP_SLOT = R_390_JMP_SLOT, .R_COPY = R_390_COPY, .R_RELATIVE = R_390_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld64.so.1", .adjust_dyn = s390x_adjust_dyn, .adjust_rel = s390x_adjust_rel, diff --git a/trunk/src/arch-sh.c b/trunk/src/arch-sh.c index 6b2914a..c5c9f52 100644 --- a/trunk/src/arch-sh.c +++ b/trunk/src/arch-sh.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -414,6 +414,7 @@ PL_ARCH = { .R_JMP_SLOT = R_SH_JMP_SLOT, .R_COPY = R_SH_COPY, .R_RELATIVE = R_SH_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux.so.2", .adjust_dyn = sh_adjust_dyn, .adjust_rel = sh_adjust_rel, diff --git a/trunk/src/arch-sparc.c b/trunk/src/arch-sparc.c index 98bacac..f55d4f7 100644 --- a/trunk/src/arch-sparc.c +++ b/trunk/src/arch-sparc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -607,6 +607,7 @@ PL_ARCH = { .R_JMP_SLOT = R_SPARC_JMP_SLOT, .R_COPY = R_SPARC_COPY, .R_RELATIVE = R_SPARC_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib/ld-linux.so.2", .adjust_dyn = sparc_adjust_dyn, .adjust_rel = sparc_adjust_rel, diff --git a/trunk/src/arch-sparc64.c b/trunk/src/arch-sparc64.c index 28c1f9f..418bcac 100644 --- a/trunk/src/arch-sparc64.c +++ b/trunk/src/arch-sparc64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2004, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -807,6 +807,7 @@ PL_ARCH = { .R_JMP_SLOT = R_SPARC_JMP_SLOT, .R_COPY = R_SPARC_COPY, .R_RELATIVE = R_SPARC_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib64/ld-linux.so.2", .adjust_dyn = sparc64_adjust_dyn, .adjust_rel = sparc64_adjust_rel, diff --git a/trunk/src/arch-x86_64.c b/trunk/src/arch-x86_64.c index 8079f1a..d5b88dd 100644 --- a/trunk/src/arch-x86_64.c +++ b/trunk/src/arch-x86_64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2006 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2006, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -505,6 +505,7 @@ PL_ARCH = { .R_JMP_SLOT = R_X86_64_JUMP_SLOT, .R_COPY = R_X86_64_COPY, .R_RELATIVE = R_X86_64_RELATIVE, + .rtype_class_valid = RTYPE_CLASS_VALID, .dynamic_linker = "/lib64/ld-linux-x86-64.so.2", .adjust_dyn = x86_64_adjust_dyn, .adjust_rel = x86_64_adjust_rel, diff --git a/trunk/src/cxx.c b/trunk/src/cxx.c index e7dc4f5..5922a02 100644 --- a/trunk/src/cxx.c +++ b/trunk/src/cxx.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2007 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2007, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -307,6 +307,7 @@ remove_redundant_cxx_conflicts (struct prelink_info *info) struct find_cxx_sym_cache **cache; struct find_cxx_sym_cache *binsymcache = NULL; int ret = 0; + int rtype_class_valid; /* Don't bother doing this for non-C++ programs. */ for (i = 0; i < info->ent->ndepends; ++i) @@ -324,6 +325,8 @@ remove_redundant_cxx_conflicts (struct prelink_info *info) assert (elf_getdata (scn, binsymtab) == NULL); } + rtype_class_valid = info->dso->arch->rtype_class_valid; + state = 0; memset (&fcs1, 0, sizeof (fcs1)); memset (&fcs2, 0, sizeof (fcs2)); @@ -401,7 +404,7 @@ remove_redundant_cxx_conflicts (struct prelink_info *info) for (conflict = info->conflicts[fcs1.n].hash[cidx]; conflict; conflict = conflict->next) if (conflict->symoff == symoff - && conflict->reloc_class == RTYPE_CLASS_VALID) + && conflict->reloc_class == rtype_class_valid) break; if (conflict == NULL) @@ -558,7 +561,7 @@ check_pltref: for (l = 0; l < 251; l++) for (conflict = info->conflicts[fcs1.n].hash[l]; conflict; conflict = conflict->next) - if (conflict->reloc_class == RTYPE_CLASS_VALID + if (conflict->reloc_class == rtype_class_valid && conflict->conflict.ent) { size_t ccidx @@ -595,7 +598,7 @@ check_pltref: && conflict->conflict.ent && (conflict->conflict.ent->base + conflict->conflictval == s->u.ent->base + s->value) - && conflict->reloc_class == RTYPE_CLASS_VALID) + && conflict->reloc_class == rtype_class_valid) { pltref_remove: if (verbose > 3) diff --git a/trunk/src/get.c b/trunk/src/get.c index cea3309..05e0b54 100644 --- a/trunk/src/get.c +++ b/trunk/src/get.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009 Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -275,7 +275,12 @@ prelink_record_relocations (struct prelink_info *info, FILE *f, if (type) reloc_class = dso->arch->reloc_class (reloc_class); else - reloc_class |= RTYPE_CLASS_VALID; + { + if ((reloc_class | RTYPE_CLASS_VALID) == RTYPE_CLASS_TLS) + reloc_class |= RTYPE_CLASS_VALID; + else + reloc_class |= dso->arch->rtype_class_valid; + } while (*symname == ' ' || *symname == '\t') ++symname; @@ -452,7 +457,12 @@ prelink_record_relocations (struct prelink_info *info, FILE *f, if (type) reloc_class = dso->arch->reloc_class (reloc_class); else - reloc_class |= RTYPE_CLASS_VALID; + { + if ((reloc_class | RTYPE_CLASS_VALID) == RTYPE_CLASS_TLS) + reloc_class |= RTYPE_CLASS_VALID; + else + reloc_class |= dso->arch->rtype_class_valid; + } while (*symname == ' ' || *symname == '\t') ++symname; diff --git a/trunk/src/prelink.h b/trunk/src/prelink.h index 0d5aeb8..5de2f0e 100644 --- a/trunk/src/prelink.h +++ b/trunk/src/prelink.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 + Red Hat, Inc. Written by Jakub Jelinek <jakub@redhat.com>, 2001. This program is free software; you can redistribute it and/or modify @@ -159,6 +160,7 @@ struct PLArch int R_COPY; int R_JMP_SLOT; int R_RELATIVE; + int rtype_class_valid; int (*arch_adjust) (DSO *dso, GElf_Addr start, GElf_Addr adjust); int (*adjust_section) (DSO *dso, int n, GElf_Addr start, GElf_Addr adjust); int (*adjust_dyn) (DSO *dso, int n, GElf_Dyn *dyn, GElf_Addr start, |