Stefan Reinauer <[EMAIL PROTECTED]> writes:

> * Christer Weinigel <[EMAIL PROTECTED]> [020710 02:01]:
> > By the way, I'm seeing a really strange error:
> > 
> >     Finding PCI configuration type.
> >     PCI: Using configuration type 1
> >     Scanning PCI bus...PCI: pci_scan_bus for bus 0
> >     Error! malloc: Free_mem_ptr >= free_mem_end_ptr
> > 
> > I decided to try to figure out what was going on and added a debug
> > message to print out the values of eheap and heap in
> > freebios/src/lib/malloc.c: 
> > 
> >     void *malloc(size_t size)
> >     {
> >             void *p;
> >  
> > + printk_info("heap = 0x%lx, eheap = 0x%lx\n", (long)_heap, (long)_eheap);
> 
> > MALLOCDBG((__FUNCTION__ " Enter, size %d, free_mem_ptr %p\n", size,
> free_mem_ptr));
> 
> > 
> > what is so strange is that this fixed the problem and it is
> > repeatable, if I remove the printk, the error will reappear.  Has
> > anyone seen anything like this?  Could it be gcc acting up?
> > 
> >     bash$ gcc -v
> >     Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
> >     gcc version 2.95.3 20010315 (SuSE)
> > 
> >     bash$ ld -v
> >     GNU ld version 2.11.90.0.29 (with BFD 2.11.90.0.29)
>  
> 
> I had a very similar problem where free_mem_end_ptr always got set to 0,
> thus malloc did not work. I fixed it with using some older (2.10.x iirc)
> binutils.
> Did not have time to investigate this in detail yet though

That is right, I had forgotten.  So investigating the symbols with
objdump, nm, or readelf, and seeing if something like the above is
happening in the problem case would be useful.

I have used both:
GNU ld version 2.10.90 (with BFD 2.10.0.18)
and:
GNU ld version 2.12.90.0.12 20020619

without problems.

Eric

Reply via email to