[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2 |
Date: |
26 Oct 2006 16:40:38 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Greetings, and thanks!
"Page, Bill" <address@hidden> writes:
> Camm,
>
> On Wednesday, October 25, 2006 11:10 AM you wrote:
> > ...
> > OK, will try to reactivate my sourceforge status. Something
> > changed over the summer.
>
> Yes, there were some problems with access to the compile farm.
> That seems to be fixed now.
>
> > In the meantime, here is what needs doing:
> >
> > ./configure --enable-debug && make
> > cd unixport
> > make raw_pre_gcl
> > gdb raw_pre_gcl
> > (gdb) b sfasli.c:65
> > (gdb) r ./
> > (gdb) cond 1 strstr(q[u]->name,"srget")
> > (gdb) c
> > (gdb) p q[u]->name
> > (gdb) p q[u]->section->name
> > (gdb) p q[u]->flags
> >
> >
> > Thanks!
> >
>
> Here you go:
>
> ---------
>
> ppc-osx3:~/osx/new/gcl-2.6.8pre $ ./configure
> --prefix=/home/users/b/bi/billpage/osx --enable-locbfd
> --disable-statsysbfd --enable-debug
> ...
>
> ppc-osx3:~/osx/new/gcl-2.6.8pre $ make
> ...
> makeinfo --html gcl-si.texi
> makeinfo --html gcl-tk.texi
>
> ppc-osx3:~/osx/new/gcl-2.6.8pre $ cd unixport
>
> ppc-osx3:~/osx/new/gcl-2.6.8pre/unixport $ make raw_pre_gcl
> ls: ../xgcl-2/*.o: No such file or directory
> ls: ../mod/*.o: No such file or directory
> ls: ../pcl/*.o: No such file or directory
> ls: ../clcs/*.o: No such file or directory
> ls: ../clcs/clcs_*.lisp: No such file or directory
> touch raw_pre_gcl_map
> gcc -no-cpp-precomp -o raw_pre_gcl \
> -L. -lpre_gcl `echo -lm | sed -e 's/-lncurses/ /'` -lc -lgclp
>
> ppc-osx3:~/osx/new/gcl-2.6.8pre/unixport $ gdb raw_pre_gcl
> GNU gdb 5.3-20021014 (Apple version gdb-250) (Sat Dec 7 02:14:27 GMT
> 2002)
> Copyright 2002 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 "powerpc-apple-macos10".
> Reading symbols for shared libraries .. done
> (gdb) b sfasli.c:65
> Breakpoint 1 at 0xb1b54: file sfasli.c, line 65.
> (gdb) r ./
> Starting program:
> /private/automount/home/users/b/bi/billpage/osx/new/gcl-2.6.8pre/unixpor
> t/raw_pre_gcl ./
> [Switching to process 27643 thread 0xb03]
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries .. done
> DBEGIN: 0x122000
> mach_mapstart: 0x548000
> heap_end: 0x548000
> core_end: 0x548000
> mach_brkpt: 0x548000
> mach_maplimit: 0x20122000
> --- List of All Regions ---
> address size prot maxp zone_name
> 0 0x1000 none none (no zone)
> 0x1000 0x1000 r x rwx (no zone)
> 0x2000 0xaf000 r x rwx (no zone)
> 0xb1000 0x1000 r x rwx (no zone)
> 0xb2000 0x70000 r x rwx (no zone)
> 0x122000 0x6000 rw rwx (no zone)
> 0x128000 0x420000 rw rwx (no zone)
> 0x548000 0x2dd000 r rwx (no zone)
> 0x825000 0x40000 rw rwx DefaultMallocZone
> 0x865000 0x20000 rw rwx DefaultMallocZone
> --- List of Regions to be Dumped ---
> address size prot maxp zone_name
> 0 0x1000 none none (no zone)
> 0x1000 0x121000 r x rwx (no zone)
> 0x122000 0x426000 rw rwx (no zone)
> 0x548000 0x2dd000 r rwx (no zone)
> 0x825000 0x60000 rw rwx DefaultMallocZone
> --- Header Information ---
> Magic = 0xfeedface
> CPUType = 18
> CPUSubType = 0
> FileType = 0x2
> NCmds = 10
> SizeOfCmds = 1620
> Flags = 0x00000085
> Highest address of load commands in input file: 0x825000
> Lowest offset of all sections in __TEXT segment: 0xb18
> --- List of Load Commands in Input File ---
> no cmd cmdsize name address size
> 0 LC_SEGMENT 0x38 __PAGEZERO 0 0x1000
> 1 LC_SEGMENT 0x258 __TEXT 0x1000 0x121000
> __text 0x1b18 0x10a410
> __picsymbol_stub 0x10bf28 0x18e4
> __symbol_stub 0x10d80c 0
> __cstring 0x10d80c 0x12714
> __literal4 0x11ff20 0x18
> __literal8 0x11ff38 0xc8
> __const 0x120000 0x1f9c
> __eh_frame 0x121f9c 0x60
> 2 LC_SEGMENT 0x214 __DATA 0x122000 0x426000
> __data 0x122000 0x25b0
> __la_symbol_ptr 0x1245b0 0x2c4
> __nl_symbol_ptr 0x124874 0x8fc
> __dyld 0x125170 0x1c
> __const 0x12518c 0x2748
> __bss 0x1278d8 0x8f28
> __common 0x130800 0x416d68
> 3 LC_SEGMENT 0x38 __LINKEDIT 0x548000 0x2dd000
> 4 LC_LOAD_DYLINKER 0x1c
> 5 LC_LOAD_DYLIB 0x34
> 6 LC_SYMTAB 0x18
> 7 LC_DYSYMTAB 0x50
> 8 LC_TWOLEVEL_HINTS 0x10
> 9 LC_UNIXTHREAD 0xb0
> --- Load Commands written to Output File ---
> Writing segment __PAGEZERO at 0 - 0 (sz:
> 0)
> Writing segment __TEXT at 0 - 0x121000 (sz:
> 0x121000)
> Writing segment __DATA at 0x121000 - 0x127000 (sz:
> 0x6000)
> section __data at 0x121000 - 0x1235b0 (sz:
> 0x25b0)
> section __la_symbol_ptr at 0x1235b0 - 0x123874 (sz:
> 0x2c4)
> section __nl_symbol_ptr at 0x123874 - 0x124170 (sz:
> 0x8fc)
> section __dyld at 0x124170 - 0x12418c (sz:
> 0x1c)
> section __const at 0x12418c - 0x1268d4 (sz:
> 0x2748)
> section __bss at 0x1268d8 - 0x12f800 (sz:
> 0x8f28)
> section __common at 0x12f800 - 0x546568 (sz:
> 0x416d68)
> Writing segment __DATA at 0x547000 - 0x547000 (sz:
> 0)
> Writing segment __LINKEDIT at 0x547000 - 0x823df4 (sz:
> 0x2dcdf4)
> Writing LC_LOAD_DYLINKER command
> Writing LC_LOAD_DYLIB command
> Writing LC_SYMTAB command
> Fixed up 17/17 external relocation entries in data segment.
> Writing LC_DYSYMTAB command
> Writing LC_TWOLEVEL_HINTS command
> Writing LC_UNIXTHREAD command
> 1068 unused bytes follow Mach-O header
>
> Program received signal SIGTRAP, Trace/breakpoint trap.
> 0x8fe19090 in __dyld__dyld_start ()
>
> (gdb) cond 1 (int) strstr(q[u]->name,"srget")
>
> (gdb) c
> Continuing.
> GCL (GNU Common Lisp) April 1994 131072 pages
> Building symbol table for
> /private/automount/home/users/b/bi/billpage/osx/new/gcl-2.6.8pre/unixpor
> t/raw_pre_gcl.tmp ..
>
> Breakpoint 1, build_symbol_table_bfd () at sfasli.c:65
> 65 if (strncmp(q[u]->section->name,"*UND*",5) && !(q[u]->flags
> & BSF_WEAK))
>
> (gdb) p q[u]->name
> $1 = 0x5742d1 "___srget"
>
> (gdb) p q[u]->section->name
> $2 = 0x114e74 "*UND*"
>
> (gdb) p q[u]->flags
> $3 = 2
>
> (gdb) c
> Continuing.
> loading ./../lsp/gcl_export.lsp
> loading ./../lsp/gcl_defmacro.lsp
> loading ./../lsp/gcl_evalmacros.lsp
> loading ./../lsp/gcl_top.lsp
> loading ./../lsp/gcl_module.lsp
> loading ./../lsp/gcl_autoload.lsp
>
> >(quit)
>
> Program exited normally.
> (gdb) quit
> ppc-osx3:~/osx/new/gcl-2.6.8pre/unixport $
>
> --------
>
> Note I had to add (int) to:
>
> cond 1 (int) strstr(q[u]->name,"srget")
>
> to avoid an error message about unknow return type.
>
> > > > ...
> > > > Come to think of it, there may be a problem like the following:
> > > >
> > > > On Linux systems, libc symbols are postpended with a @@ and
> > > > version number. Here is our code to deal with this (sfasli.c):
> > > > (my comments in ****)
> > > >
> > > > for (u=0;u<v;u++) {
> > > > char *c=NULL;
> > > > struct bfd_link_hash_entry *h;
> > > >
> > > > if (!*q[u]->name)
> > > > continue;
> > > >
>
> This is line 65:
>
> > > > if (strncmp(q[u]->section->name,"*UND*",5) &&
> > > > !(q[u]->flags & BSF_WEAK))
> > > > continue;
> > > >
>
> Is value of flags=2 ok? What is BSF_WEAK?
>
> h/bfd.h:#define BSF_WEAK 0x80
>
> > > > *** the above might skip ___srget ***
> > > >
>
> It looks like it's gonna skip to me. Is that good or bad?
>
Actually, it looks like it will not skip due to the section->name.
Please verify this by stepping through with n and this point. In
fact, if you can step from this point to the bottom of this for loop
iteration, and then
(gdb) p
*bfd_link_hash_lookup(link_info.hash,q[u]->name,MY_BFD_FALSE,MY_BFD_FALSE,MY_BFD_TRUE)
that would be most helpful.
> Also it looks like there is no prepended @@ in q[u]->name.
>
This is OK, as there is no other junk that needs special processing.
> > > > if ((c=(char *)strstr(q[u]->name,"@@"))) {
> > > > *c=0;
> > > > if
> > > > (!(h=bfd_link_hash_lookup(link_info.hash,q[u]->name,MY_BFD_TRU
> > > > E,MY_BFD_TRUE,MY_BFD_TRUE)))
> > > > FEerror("Cannot make new hash entry",0);
> > > > h->type=bfd_link_hash_new;
> > > > } else if
> > > >
> > > > (!(h=bfd_link_hash_lookup(link_info.hash,q[u]->name,MY_BFD_FAL
> > > SE,MY_BFD_FALSE,MY_BFD_TRUE)) &&
> > > >
> > > > !(h=bfd_link_hash_lookup(link_info.hash,q[u]->name,MY_BFD_TRUE
> > > > ,MY_BFD_TRUE,MY_BFD_TRUE)))
> > > > FEerror("Cannot make new hash entry",0);
> > > >
> > > > *** There might be some other mangling than the @ for ___srget ***
> > > >
> > > > if (h->type!=bfd_link_hash_defined) {
> > > > if (!q[u]->section)
> > > > FEerror("Symbol ~S is missing
> > > > section",1,make_simple_string(q[u]->name));
> > > > if (!my_plt(q[u]->name,&pa)) {
> > > > /* printf("my_plt %s %p\n",q[u]->name,(void *)pa); */
> > > > if (q[u]->value && q[u]->value!=pa)
> > > > FEerror("plt address mismatch", 0);
> > > > else
> > > > q[u]->value=pa;
> > > > }
> > > > if (q[u]->value) {
> > > > h->type=bfd_link_hash_defined;
> > > > h->u.def.value=q[u]->value+q[u]->section->vma;
> > > > h->u.def.section=q[u]->section;
> > > > }
> > > > }
> > > >
> > > > if (c) {
> > > > *c='@';
> > > > c=NULL;
> > > > }
> > > > }
> > > >
> > > > This might be instructive with srget in place of cos:
> > > >
> > > > objdump -x /usr/lib/gcl-2.6.7/unixport/saved_gcl |grep cos
> > > > 0812f590 l F .text 0000015b number_cos
> > > > 00000000 F *UND* 00000026 cos@@GLIBC_2.0
> > > > 0804fb40 F *UND* 00000074 acosh@@GLIBC_2.0
> > > > 08050440 F *UND* 00000081 cosh@@GLIBC_2.0
> > > > 0812f6f0 g F .text 00000047 Lcos
> > > > 00000000 F *UND* 00000026 cosf@@GLIBC_2.0
> > > > 08051200 F *UND* 00000075 acos@@GLIBC_2.0
> > > >
> > >
> > > There is no objdump on this OSX 10.2 system. :-(
> > >
> > > Shall I try to install GNU binutils? The version bundled with GCL
> > > or a newer one?
> >
> > The one in the GCL sources should be fine.
> >
>
> See next email.
>
Thanks again!
Take care,
> Regards,
> Bill Page.
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
- [Gcl-devel] Re: [Axiom-developer] Re: gcl-2.6.8pre on MAC OSX 10.2, (continued)
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/18
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/21
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/23
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/23
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/24
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/25
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2,
Camm Maguire <=
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/26
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/27
[Gcl-devel] Re: gcl-2.6.8pre on MAC OSX 10.2, Camm Maguire, 2006/10/31