[Top][All Lists]

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

Re: [Gcl-devel] Re: BFD relocations

From: Camm Maguire
Subject: Re: [Gcl-devel] Re: BFD relocations
Date: 10 Jun 2002 18:35:02 -0400

Greetings!  Thank you all once again.  To finalize this issue for gcl,
could you perhaps guide me as to the following:

1) Is there a central place where I can find the analogous
   data-cache-flushing assembly instructions for the Debian supported
   architectures?  Barring that, decentralized places?

2) The existing gcl code (on x86 for example), loads .text and .data
   sections, and allocates space for .bss but of course doesn't load.
   I've tried not allocating space for .bss on x86, as the section
   flags seem to indicate, and all still works fine.  Is this
   portable?  My eventual intention is to allocate space only if one
   of SEC_ALLOC and SEC_LOAD are set.

3) I don't understand stripping of binaries very well, but I was
   wondering if after relocation I could reclaim some of the space of
   the object by discarding symbol information as when stripping an
   executable.  Does this shrink .text and .data section space, or
   does this just refer to the .strtab etc. sections?

Thanks again! 

Paul Koning <address@hidden> writes:

> > Greetings!  I found an earlier cache flushing snippet for another
> > arch:
> >
> > #define CLEAR_CACHE do { unsigned long ps = getpagesize(); \
> >                      char *beg = (char *)((unsigned long 
> > )(memory->cfd.cfd_start) & ~(ps-1)); \
> >                      char *end =  ROUND_UP(memory->cfd.cfd_start + \
> >                                       memory->cfd.cfd_size,ps); \
> >                        
> > mprotect(beg,end-beg,PROT_READ|PROT_WRITE|PROT_EXEC);} while(0)
> > 
> > Can mprotect be used in this way to portably flush the data cache?
> I very much doubt it.  I don't see any real connection between page
> protection and the cache.  Some OS might decide that changing
> protection is a reason to flush the cache; another might not.  For
> some CPU targets this may be necessary or useful, for others it may be
> entirely superfluous.
>        paul

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]