Bug 671188 - Don't fail on R_*_NONE relocations with an empty r_offset. r=tglek
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Jul 2011 10:15:28 +0200
changeset 72860 c41f5c1ce4f161c077d28e29bfaff6e90ca82a8f
parent 72859 6d85a68e820e3cab4f63c0425b9ccc812532d2ce
child 72861 b86067d689a98c073be8a919c10b5605299b34d9
push id20776
push usereakhgari@mozilla.com
push dateFri, 15 Jul 2011 12:13:35 +0000
treeherdermozilla-central@9349ae9094f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstglek
bugs671188
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 671188 - Don't fail on R_*_NONE relocations with an empty r_offset. r=tglek
build/unix/elfhack/elfhack.cpp
--- a/build/unix/elfhack/elfhack.cpp
+++ b/build/unix/elfhack/elfhack.cpp
@@ -411,16 +411,19 @@ int do_relocation_section(Elf *elf, unsi
     Elf_SymValue *sym = symtab->lookup("__cxa_pure_virtual");
 
     std::vector<Rel_Type> new_rels;
     Elf_RelHack relhack_entry;
     relhack_entry.r_offset = relhack_entry.r_info = 0;
     int entry_sz = (elf->getClass() == ELFCLASS32) ? 4 : 8;
     for (typename std::vector<Rel_Type>::iterator i = section->rels.begin();
          i != section->rels.end(); i++) {
+        // We don't need to keep R_*_NONE relocations
+        if (!ELF32_R_TYPE(i->r_info))
+            continue;
         ElfSection *section = elf->getSectionAt(i->r_offset);
         // __cxa_pure_virtual is a function used in vtables to point at pure
         // virtual methods. The __cxa_pure_virtual function usually abort()s.
         // These functions are however normally never called. In the case
         // where they would, jumping to the NULL address instead of calling
         // __cxa_pure_virtual is going to work just as well. So we can remove
         // relocations for the __cxa_pure_virtual symbol and NULL out the
         // content at the offset pointed by the relocation.