axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] Re: [Gcl-devel] changes in binutils break gcl


From: Camm Maguire
Subject: [Axiom-developer] Re: [Gcl-devel] changes in binutils break gcl
Date: 24 Nov 2004 11:10:49 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Here is the fix you need.  Works with old and new
binutils.  Posted to the errata page on the website.  Tim, this should
address your earlier reports too.

=============================================================================
Index: o/sfaslbfd.c
===================================================================
RCS file: /cvsroot/gcl/gcl/o/sfaslbfd.c,v
retrieving revision 1.18
diff -u -r1.18 sfaslbfd.c
--- o/sfaslbfd.c        23 Aug 2004 23:09:23 -0000      1.18
+++ o/sfaslbfd.c        24 Nov 2004 16:00:09 -0000
@@ -256,7 +256,7 @@
 
     current=round_up(current,1<<s->alignment_power);
 
-    current+=s->_raw_size;
+    current+=bfd_section_size(b,s);
 
   }
   curr_size=(unsigned long)current;
@@ -281,7 +281,7 @@
 
     m=round_up(m,1<<s->alignment_power);
     s->output_section->vma=(unsigned long)m;
-    m+=s->_raw_size;
+    m+=bfd_section_size(b,s);
             
   }
 
@@ -346,7 +346,7 @@
                                             v,0,q)) 
        FEerror("Cannot get relocated section contents\n",0);
 
-     memcpy((void *)(unsigned long)s->output_section->vma,v,s->_raw_size);
+     memcpy((void *)(unsigned 
long)s->output_section->vma,v,bfd_section_size(b,s));
      
    }
  }
=============================================================================

Take care,

Matthew Kenendy <address@hidden> writes:

> Hi Camm,
> 
> Camm Maguire <address@hidden> writes:
> 
> [...]
> 
> > Actually, dont we want this:
> >
> > #define bfd_get_section_size_before_reloc(section) \
> >      ((section)->_raw_size)
> 
> I don't really know, however bfd.h from this binutils version has the
> following which is similar:
> 
> #define bfd_get_section_limit(bfd, sec) \
>   (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
>    / bfd_octets_per_byte (bfd))
> 
> > Also, have you been able to test your build against the new binutils?
> > Last I heard there were other problems.  Feedback most helpful,
> > esp. as this binutils is not in Debian yet.
> 
> There are no other build problems, but loading compiled files at
> runtime does fail.  Attached is a backtrace for gcl-2.6.5 built with
> --enable-dynsysbfd --disable-statsysfd.
> 
> Are there any other details I can provide for you?
> 
> address@hidden:/mnt/space/tmp/gcl-2.6.5$ gdb
> GNU gdb 6.2.1
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i686-pc-linux-gnu".
> (gdb) file unixport/saved_gcl
> Reading symbols from /mnt/space/tmp/gcl-2.6.5/unixport/saved_gcl...done.
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) r
> Starting program: /mnt/space/tmp/gcl-2.6.5/unixport/saved_gcl 
> GCL (GNU Common Lisp)  2.6.5 CLtL1    Nov 23 2004 09:36:22
> Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
> Binary License:  GPL due to GPL'ed components: (READLINE BFD UNEXEC)
> Modifications of this banner must retain notice of a compatible license
> Dedicated to the memory of W. Schelter
> 
> Use (help) to get some basic information on how to use GCL.
> 
> >(load (compile-file "foo.lisp"))
> 
> Compiling foo.lisp.
> End of Pass 1.  
> End of Pass 2.  
> OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
> Finished compiling foo.lisp.
> Loading foo.o
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xb7ef1a86 in bfd_elf32_slurp_symbol_table () from 
> /usr/lib/libbfd-2.15.92.0.2.so
> 
> (gdb) bt full
> #0  0xb7ef1a86 in bfd_elf32_slurp_symbol_table () from 
> /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #1  0xb7ef1d51 in bfd_elf32_slurp_reloc_table () from 
> /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #2  0xb7efea57 in _bfd_elf_canonicalize_reloc () from 
> /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #3  0xb7ecf1cc in bfd_canonicalize_reloc () from 
> /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #4  0xb7ed8e5f in bfd_generic_get_relocated_section_contents ()
>    from /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #5  0xb7ecfac3 in bfd_get_relocated_section_contents ()
>    from /usr/lib/libbfd-2.15.92.0.2.so
> No symbol table info available.
> #6  0x0806ec48 in fasload (faslfile=0x8577438) at sfaslbfd.c:352
>       v = (void *) 0xbfffddb0
>       data = 0x805eb25
>       filename = "foo.o", '\0' <repeats 19 times>, 
> "\017\000\000\000\017\000\000\000\224öÿ¿ 
> öÿ¿xßÿ¿\0223\f\b\n\000\000\000\000\006â·\000\000\000\000\000\000\000\000\f\000\000\000\224öÿ¿¸ßÿ¿î|\n\b\n\000\000\000\000\006â·\000\000\000\000¸ßÿ¿\016\000\000\000ÀÜ6\b\203äÚ·ôÿá·ÿÿÔ·\001\000\000\000ÀÜ6\b\016\000\000\000\000\006â·\200ûá·Üßÿ¿»êÔ·\000\006â·ÀÜ6\b\016\000\000\000÷\r\a\bôÿá·\000\006â·\000\000\000\000\000àÿ¿B÷Ô·\000\006â·ÀÜ6\b\016\000\000\000xï7\bôÿá·\000\006â·\200ûá·\030"...
>       init_address = 0
>       memory = 0x8384b2c
>       max_align = 4
>       current = (void *) 0x0
>       curr_size = 0
>       old_vs_base = (object *) 0x81e297c
>       old_vs_top = (object *) 0x81e29bc
>       nbfd = 1
>       b = (bfd *) 0x83aefb0
>       myerr = bfd_error_wrong_format
>       u = 28
>       v = 28
>       q = (asymbol **) 0xbfffddc0
>       s = (asection *) 0x83b3bb4
>       the_start = (void *) 0x83af1a0
>       start_address = (void *) 0x83af1a0
>       m = (void *) 0x83af1a0
>       dum = {FIX = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', 
>     FIXVAL = 0}, big = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', 
>     big_mpz_t = {_mp_alloc = 0, _mp_size = 137901976, _mp_d = 0x0}}, rat = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', rat_den = 0x0, 
>     rat_num = 0x8383798}, SF = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 
> 0 '\0', 
>     SFVAL = 0}, LF = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', 
>     LFVAL = 4.5840268370521081e-269}, cmp = {t = 16 '\020', flag = 0 '\0', s 
> = 0 '\0', 
>     m = 0 '\0', cmp_real = 0x0, cmp_imag = 0x8383798}, ch = {t = 16 '\020', 
>     flag = 0 '\0', s = 0 '\0', m = 0 '\0', ch_code = 0, ch_font = 0 '\0', 
>     ch_bits = 0 '\0'}, s = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 
> '\0', 
>     s_dbind = 0x0, s_sfdef = 0x8383798 <imag_two+27096>, st_self = 0x0, 
> st_fillp = 0, 
>     s_gfdef = 0x0, s_plist = 0x0, s_hpack = 0x0, s_stype = 0, s_mflag = 0}, p 
> = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', p_name = 0x0, 
>     p_nicknames = 0x8383798, p_shadowings = 0x0, p_uselist = 0x0, 
> p_usedbylist = 0x0, 
>     p_internal = 0x0, p_external = 0x0, p_internal_size = 0, p_external_size 
> = 0, 
>     p_internal_fp = 0, p_external_fp = 0, p_link = 0x0}, c = {t = 16 '\020', 
>     flag = 0 '\0', s = 0 '\0', m = 0 '\0', c_cdr = 0x0, c_car = 0x8383798}, 
> ht = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', ht_self = 0x0, 
>     ht_rhsize = 0x8383798, ht_rhthresh = 0x0, ht_nent = 0, ht_size = 0, 
> ht_test = 0}, 
>   a = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', a_displaced = 
> 0x0, 
>     a_rank = 14232, a_elttype = 2104, a_self = 0x0, a_adjustable = 0, 
> a_offset = 0, 
>     a_dim = 0, a_dims = 0x0}, v = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', 
>     m = 0 '\0', v_displaced = 0x0, v_hasfillp = 14232, v_elttype = 2104, 
> v_self = 0x0, 
>     v_fillp = 0, v_dim = 0, v_adjustable = 0, v_offset = 0}, st = {t = 16 
> '\020', 
>     flag = 0 '\0', s = 0 '\0', m = 0 '\0', st_displaced = 0x0, st_hasfillp = 
> 14232, 
>     st_adjustable = 2104, st_self = 0x0, st_fillp = 0, st_dim = 0}, ust = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', ust_displaced = 
> 0x0, 
>     ust_hasfillp = 14232, ust_adjustable = 2104, ust_self = 0x0, ust_fillp = 
> 0, 
>     ust_dim = 0}, bv = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', 
>     bv_displaced = 0x0, bv_hasfillp = 14232, bv_elttype = 2104, bv_self = 
> 0x0, 
>     bv_fillp = 0, bv_dim = 0, bv_adjustable = 0, bv_offset = 0}, str = {t = 
> 16 '\020', 
>     flag = 0 '\0', s = 0 '\0', m = 0 '\0', str_def = 0x0, str_self = 
> 0x8383798}, sm = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', sm_fp = 0x0, 
>     sm_object0 = 0x8383798, sm_object1 = 0x0, sm_int0 = 0, sm_int1 = 0, 
>     sm_buffer = 0x0, sm_mode = 0 '\0', sm_flags = 0 '\0', sm_fd = 0}, rnd = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', rnd_value = 0}, rt 
> = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', rt_self = 0x0}, pn 
> = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', pn_host = 0x0, 
>     pn_device = 0x8383798, pn_directory = 0x0, pn_name = 0x0, pn_type = 0x0, 
>     pn_version = 0x0}, cf = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 
> '\0', 
>     cf_name = 0x0, cf_self = 0x8383798 <imag_two+27096>, cf_data = 0x0}, cc = 
> {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', cc_name = 0x0, 
>     cc_self = 0x8383798 <imag_two+27096>, cc_env = 0x0, cc_data = 0x0, 
> cc_envdim = 0, 
>     cc_turbo = 0x0}, cl = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 
> '\0', 
>     cl_name = 0x0, cl_self = 0x8383798 <imag_two+27096>, cl_data = 0x0, 
> cl_argd = 0, 
>     cl_envdim = 0, cl_env = 0x0}, sfn = {t = 16 '\020', flag = 0 '\0', s = 0 
> '\0', 
>     m = 0 '\0', sfn_name = 0x0, sfn_self = 0x8383798 <imag_two+27096>, 
> sfn_data = 0x0, 
>     sfn_argd = 0}, vfn = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 
> '\0', 
>     vfn_name = 0x0, vfn_self = 0x8383798 <imag_two+27096>, vfn_data = 0x0, 
>     vfn_minargs = 0, vfn_maxargs = 0}, cfd = {t = 16 '\020', flag = 0 '\0', s 
> = 0 '\0', 
>     m = 0 '\0', cfd_start = 0x0, cfd_size = 137901976, cfd_fillp = 0, 
> cfd_self = 0x0}, 
>   spc = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', spc_dummy = 
> 0}, d = {
>     t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0'}, fixa = {t = 16 
> '\020', 
>     flag = 0 '\0', s = 0 '\0', m = 0 '\0', fixa_displaced = 0x0, fixa_rank = 
> 14232, 
>     fixa_elttype = 2104, fixa_self = 0x0, fixa_adjustable = 0, fixa_offset = 
> 0, 
>     fixa_dim = 0, fixa_dims = 0x0}, sfa = {t = 16 '\020', flag = 0 '\0', s = 
> 0 '\0', 
>     m = 0 '\0', sfa_displaced = 0x0, sfa_rank = 14232, sfa_elttype = 2104, 
>     sfa_self = 0x0, sfa_adjustable = 0, sfa_offset = 0, sfa_dim = 0, sfa_dims 
> = 0x0}, 
>   lfa = {t = 16 '\020', flag = 0 '\0', s = 0 '\0', m = 0 '\0', lfa_displaced 
> = 0x0, 
>     lfa_rank = 14232, lfa_elttype = 2104, lfa_self = 0x0, lfa_adjustable = 0, 
>     lfa_offset = 0, lfa_dim = 0, lfa_dims = 0x0}}
>       link_callbacks = {add_archive_element = 0x806e3d8 
> <madd_archive_element>, 
>   multiple_definition = 0x806e3e2 <mmultiple_definition>, 
>   multiple_common = 0x806e3ec <mmultiple_common>, add_to_set = 0x806e3f6 
> <madd_to_set>, 
>   constructor = 0x806e400 <mconstructor>, warning = 0x806e40a <mwarning>, 
>   undefined_symbol = 0x806e414 <mundefined_symbol>, 
>   reloc_overflow = 0x806e434 <mreloc_overflow>, 
>   reloc_dangerous = 0x806e454 <mreloc_dangerous>, 
>   unattached_reloc = 0x806e474 <munattached_reloc>, notice = 0x806e47e 
> <mnotice>}
>       link_order = {next = 0x0, type = bfd_indirect_link_order, offset = 0, 
> size = 0, 
>   u = {indirect = {section = 0x83b3bb4}, data = {size = 138099636, contents = 
> 0x0}, 
>     reloc = {p = 0x83b3bb4}}}
>       entry_name = "\000init_"
>       entry_name_ptr = 0xbfffdee1 "init_"
> #7  0x080aa002 in Lload () at file.d:1842
>       old_bds_top = 0x8283dc8
>       i = 136194436
>       strm1 = 0x81e2980
>       narg = 1
>       DPPbase = (object *) 0x81e297c
> #8  0x080a0d5e in eval (form=0x8369aa0) at eval.c:1090
>       temporary = 0x8369aa0
>       fun = 0x8387e34
>       x = 0x838a550
>       top = (object *) 0x81e2980
>       base = (object *) 0x81e297c
> #9  0x080a1258 in fLeval (x0=0x8531c30) at eval.c:1178
>       lex = (object *) 0x81e2920
> #10 0x080b32a1 in c_apply_n (fn=0x80a11fc <fLeval>, n=1, x=0x81e2968) at 
> funlink.c:271
>       res = 0x8369aa0
> #11 0x080504db in IapplyVector (fun=0x8384e24, nargs=1, base=0x81e2968)
>     at nfunlink.c:229
>       res = 0xb7e1fff4
>       abase = (object *) 0x81e2968
>       i = 1
>       oldtop = (object *) 0x81e2968
>       atypes = 0
> #12 0x0809ef38 in funcall (fun=0x8384e24) at eval.c:190
>       res = 0xbfffef38
>       b = (object *) 0x81e2964
>       n = 1
>       temporary = 0x4
>       x = 0x81e2964
>       top = (object * volatile) 0x8
>       lex = (object *) 0xbfffef38
>       old_bds_top = 0x837ef48
>       b = 137919404
>       c = 134636159
> #13 0x0809fea1 in symlispcall (sym=0x83831f8, base=0x81e2964, narg=1) at 
> eval.c:507
>       fun = 0x8384e24
> #14 0x0815a9e7 in LI1 () at gcl_top.c:140
>       V6 = 0x8289240
>       base = (object * volatile) 0x81e293c
>       V4 = 0x8380f70
>       V2 = 0x8049b5c
>       V1 = 0x8369aa0
>       sup = (object * volatile) 0x81e2974
> #15 0x0809e282 in quick_call_sfun (fun=0x84ddfa0) at eval.c:117
>       i = 0
>       n = 0
>       restype = f_object
>       x = (object *) 0x81e293c
>       res = 0xb7ffd508
>       base = (object *) 0x81e293c
>       temp_ar = (object *) 0xbfffefe0
> #16 0x0809eeb2 in funcall (fun=0x84ddfa0) at eval.c:178
>       temporary = 0xb7ffa58a
>       x = 0xbffff0a0
>       top = (object * volatile) 0xb8000fd4
>       lex = (object *) 0x1000
>       old_bds_top = 0x837eed0
>       b = 137903596
>       c = 134951618
> #17 0x08050604 in IapplyVector (fun=0x84ddfa0, nargs=0, base=0x81e293c)
>     at nfunlink.c:239
>       res = 0x0
>       abase = (object *) 0x0
>       i = -1073746032
>       oldtop = (object *) 0x81e293c
>       atypes = 0
> #18 0x080a0fd6 in fLfuncall (fun=0x84ddfa0) at eval.c:1140
>       Xxvl = {0xea343, 0xbffff694, 0xbffff620, 0xbffff198, 0xbfffef70, 
> 0x80b26cf, 
>   0x0, 0xb7fe95a2, 0xb7fe91ec, 0xb7fe9000, 0xbffff190, 0xbffff190, 
> 0xb80011c0, 0x2, 
>   0xb8000fd4, 0xffffffe8, 0x4, 0x0, 0xb7ced240, 0xb80014e0, 0x7, 0xb8000ff0, 
>   0xb7fe940c, 0xb7fe95a2, 0xb7fe91ec, 0xb7fe9000, 0x8049f2c, 0x0, 0xb80011c0, 
> 0x2, 
>   0xb80011c0, 0x0, 0xbffff180, 0x837eed0, 0xbffff2b8, 0x8050877, 0x808eb2b, 
> 0x2, 
>   0xbffff1a0, 0xbffff190, 0x1, 0x0, 0x0, 0xbffff1a8, 0x837eed0, 0x81e293c, 
> 0xbffff2a8, 
>   0x80b32c2, 0x8387bac, 0x853bb10, 0x8, 0x81e2900, 0xbffff694, 0xbffff620, 
> 0xbffff2e8, 
>   0xb7ff6c13, 0x8049877, 0xb7fb3a0c, 0xb8000fd4, 0xb7fb3e30, 0x0, 0xbffff228, 
>   0xb7ff1c31, 0xb7cfeb14, 0x8049ca7}
>       ap = 0xbffff218 "h\233\004\bÔ\017"
>       new = (object *) 0xbffff0e0
>       n = 1
> #19 0x080b32a1 in c_apply_n (fn=0x80a0f44 <fLfuncall>, n=1, x=0x81e2938)
>     at funlink.c:271
>       res = 0x8369aa0
> #20 0x080504db in IapplyVector (fun=0x8384e4c, nargs=1, base=0x81e2938)
>     at nfunlink.c:229
>       res = 0x1
>       abase = (object *) 0x81e2938
>       i = -1073744984
>       oldtop = (object *) 0x81e2938
>       atypes = 0
> #21 0x0809ef38 in funcall (fun=0x8384e4c) at eval.c:190
>       res = 0x81e2958
>       b = (object *) 0x81e2934
>       n = 1
>       temporary = 0x81e2900
>       x = 0x2
>       top = (object * volatile) 0x805440f
>       lex = (object *) 0xbffff3d8
>       old_bds_top = 0x81e2900
>       b = 137891696
>       c = 0
> #22 0x0809f844 in funcall_no_event (fun=0x8384e4c) at eval.c:381
> No locals.
> #23 0x080a0d6b in eval (form=0x8369aa0) at eval.c:1092
>       temporary = 0x81e2900
>       fun = 0x8383240
>       x = 0x8384e4c
>       top = (object *) 0x81e2938
>       base = (object *) 0x81e2934
> #24 0x0809f5b6 in funcall (fun=0x852efe0) at eval.c:327
>       not_pushed = 1
>       temporary = 0x85e0f30
>       x = 0x84f2de0
>       top = (object * volatile) 0x81e2930
>       lex = (object *) 0x81e290c
>       old_bds_top = 0x8283d78
>       b = 1
>       c = 0
> #25 0x0809f844 in funcall_no_event (fun=0x85e0d14) at eval.c:381
> No locals.
> #26 0x080a0d6b in eval (form=0x8369aa0) at eval.c:1092
>       temporary = 0xb80014e0
>       fun = 0x84ea9b4
>       x = 0x85e0d14
>       top = (object *) 0x81e2920
>       base = (object *) 0x81e2920
> #27 0x0809f5b6 in funcall (fun=0x852eff0) at eval.c:327
>       not_pushed = 0
>       temporary = 0x85e0f84
>       x = 0x84f2d14
>       top = (object * volatile) 0x81e291c
>       lex = (object *) 0x81e2900
>       old_bds_top = 0x8283d78
>       b = 1
>       c = 0
> #28 0x080a058a in super_funcall (fun=0x85e0ff0) at eval.c:743
> No locals.
> #29 0x0804b6c8 in main (argc=1, argv=0xbffff694, envp=0xbffff69c) at 
> main.c:369
>       rl = {rlim_cur = 4294967295, rlim_max = 4294967295}
> (gdb) quit
> 
> 
> -- 
> Matthew Kennedy

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

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