tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Sample patch from Mercurial repository


From: KHMan
Subject: [Tinycc-devel] Sample patch from Mercurial repository
Date: Mon, 29 Oct 2007 02:59:15 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4

Hi all,

Attached is a sample patch based on the Mercurial repository. I
assume revisions up to 395 is already in the official CVS, so
perhaps I shall try and see how many trivial patches I can make
from revision 396 onwards, versus current Savannah CVS. No quality
assurance beyond trying a "make all" on Ubuntu. Comments?

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

# HG changeset patch
# User address@hidden
# Date 1160276413 14400
# Node ID 928147ea8ab65f7f295692021e37586251c3bce6
# Parent  f357b2f8add53b403bfe7edd71c519b4709a1515
Fix "invalid relocation entry" problem on ubuntu.  Fix from Bernhard
Fischer: http://lists.gnu.org/archive/html/tinycc-devel/2005-09/msg00051.html

diff -urN tinycc_cvs/tccelf.c tinycc_new/tccelf.c
--- tinycc_cvs/tccelf.c 2007-10-29 00:03:55.171875000 +0800
+++ tinycc_new/tccelf.c 2007-10-29 02:38:33.296875000 +0800
@@ -1874,7 +1874,6 @@
 
     /* second short pass to update sh_link and sh_info fields of new
        sections */
-    sm = sm_table;
     for(i = 1; i < ehdr.e_shnum; i++) {
         s = sm_table[i].s;
         if (!s || !sm_table[i].new_section)
@@ -1888,6 +1887,7 @@
             s1->sections[s->sh_info]->reloc = s;
         }
     }
+    sm = sm_table;
 
     /* resolve symbols */
     old_to_new_syms = tcc_mallocz(nb_syms * sizeof(int));
@@ -1949,9 +1949,11 @@
                 if (sym_index >= nb_syms)
                     goto invalid_reloc;
                 sym_index = old_to_new_syms[sym_index];
-                if (!sym_index) {
+               /* ignore link_once in rel section. */
+                if (!sym_index && !sm->link_once) {
                 invalid_reloc:
-                    error_noabort("Invalid relocation entry");
+                    error_noabort("Invalid relocation entry [%2d] '%s' @ %.8x",
+                        i, strsec + sh->sh_name, rel->r_offset);
                     goto fail;
                 }
                 rel->r_info = ELF32_R_INFO(sym_index, type);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]