public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: PATCH: Allow a global symbol set to common/undefined symbol
@ 2005-04-28 15:08 Etienne Lorrain
  0 siblings, 0 replies; 8+ messages in thread
From: Etienne Lorrain @ 2005-04-28 15:08 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Nick Clifton, H. J. Lu, Dave Korn, binutils

  Sometimes I feel bad.
  Thanks.

--- Daniel Jacobowitz <drow@false.org> wrote:
> On Thu, Apr 28, 2005 at 04:02:08PM +0200, Etienne Lorrain wrote:
> >   Sorry to bother again...
> > 
> >  With this patch and the source I am using, I have a problem elsewhere.
> >  It is initially due to GCC doing hidden real call to memcpy and
> >  memset when optimising for size (they consider calling those
> >  functions save space...)
> > 
> >  Basically because I am using two code segments (%cs can have two values
> >  to have twice 64 Kbytes accessible) I need two memcpy/memset, one in
> each
> >  segment. Because GCC insert real "call memset" I need to change the
> >  name of the function called in the assembler file - I am doing:
> > asm ("memcpy = xcodeseg_memcpy \n");
> > asm ("memset = xcodeseg_memset \n");
> >  So that "call memcpy" is replaced by "call xcodeseg_memcpy".
> > 
> >   With the H.J. patch in the assembler, I get messages:
> > disk.s:7307: Error: Local symbol `memcpy' can't be equated to undefined
> > symbol `xcodeseg_memcpy'
> > 
> >   I tried to define xcodeseg_memcpy as ".extern" of ".global" without
> >  success - even if they really are defined elsewhere.
> > 
> >   Is there a simple solution for my problem?
> 
> You need to mark memcpy as .globl, not xcodeseg_memcpy.
> 
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery, LLC
> 


	

	
		
__________________________________________________________________ 
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: PATCH: Allow a global symbol set to common/undefined symbol
@ 2005-04-28 14:20 Etienne Lorrain
  2005-04-28 14:35 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Etienne Lorrain @ 2005-04-28 14:20 UTC (permalink / raw)
  To: Nick Clifton, H. J. Lu; +Cc: Dave Korn, binutils, drow

  Sorry to bother again...

 With this patch and the source I am using, I have a problem elsewhere.
 It is initially due to GCC doing hidden real call to memcpy and
 memset when optimising for size (they consider calling those
 functions save space...)

 Basically because I am using two code segments (%cs can have two values
 to have twice 64 Kbytes accessible) I need two memcpy/memset, one in each
 segment. Because GCC insert real "call memset" I need to change the
 name of the function called in the assembler file - I am doing:
asm ("memcpy = xcodeseg_memcpy \n");
asm ("memset = xcodeseg_memset \n");
 So that "call memcpy" is replaced by "call xcodeseg_memcpy".

  With the H.J. patch in the assembler, I get messages:
disk.s:7307: Error: Local symbol `memcpy' can't be equated to undefined
symbol `xcodeseg_memcpy'

  I tried to define xcodeseg_memcpy as ".extern" of ".global" without
 success - even if they really are defined elsewhere.

  Is there a simple solution for my problem?
  If needed the complete source is at sourceforge (GCC-3.4.2+):
http://prdownloads.sourceforge.net/gujin/gujin-1.0.tar.gz?download
  just untar , cd gujin && make dep disk.o

  Thanks,
  Etienne.

--- Nick Clifton <nickc@redhat.com> wrote:
> Hi H. J.
> 
> > gas/
> > 2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>
> > 
> > 	* config/obj-multi.h (FAKE_LABEL_NAME): Defined.
> > 
> > 	* read.c (pseudo_set): Disallow symbol set to common symbol.
> > 
> > 	PR 857
> > 	* write.c (write_object_file): Report common symbol name when
> > 	disallowing local symbol set to common symbol.
> > 	(adjust_reloc_syms): Disallow local symbol set to undefined
> > 	symbol.
> > 
> > gas/testsuite/
> > 2005-04-25  H.J. Lu  <hongjiu.lu@intel.com>
> > 
> > 	* gas/all/assign.s: Make `x' and `y' global.
> 
> Approved - please apply.
> 
> Cheers
>    Nick
> 


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: PATCH: Allow a global symbol set to common/undefined symbol
@ 2005-04-26 14:24 Etienne Lorrain
  0 siblings, 0 replies; 8+ messages in thread
From: Etienne Lorrain @ 2005-04-26 14:24 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

--- "H. J. Lu" <hjl@lucon.org> wrote:
> On Tue, Apr 26, 2005 at 11:36:44AM +0200, Etienne Lorrain wrote:
> > /home/etienne/projet/toolchain/bin/as  -acdhls=tmp.lis -o tmp.o tmp.s
> > tmp.s: Assembler messages:
> > tmp.s:34: Error: Local symbol `dataPS2' can't be equated to common
> symbol
> > `MOUSE'
> 
> You need to make `dataPS2' global.

  Works OK, Thanks,
  Etienne.


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Binutils 2.15.97 available
@ 2005-04-25 16:21 Etienne Lorrain
  2005-04-25 18:43 ` PATCH: Allow a symbol set to common symbol + value H. J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Etienne Lorrain @ 2005-04-25 16:21 UTC (permalink / raw)
  To: Dave Korn, 'Nick Clifton', H. J. Lu; +Cc: binutils, drow

--- Dave Korn <dave.korn@artimi.com> wrote:
> > >   asm volatile (" dataPS2 = %c0 ": : "i" (&MOUSE.data.PS2));
> 
>   IIUIC, all you want to do here is initialise an assembler-level variable
> with the address of MOUSE.data.PS2 at runtime, yes?  So why not make your
> life a load easier, and do it the other way round:
> void *dataPS2 = NULL;

  I do not think my method is that complex, not going through a variable
 pointer but just defining a symbol to write to. With your pointer I would
 have to read the content of the pointer and write to this address - and
 so save another register on the stack to store the address to write to
 in my interrupt treatment.
 This address is known at link time so there is no need to put it in
 a variable pointer.

  I can accept the argument of H.J. saying that the behaviour I am waiting
 is not guarantied - but I am sure it was working perfectly in my case,
 with binutils-2.15.
 The address is the same, the PS2 mouse is perfectly working in Gujin,
 and this field is only written under interrupt and only read in C.

  That is not a real problem for my application, I will initialise to
 get the MOUSE structure in BSS instead of COMMON.

  Thanks,
  Etienne.


	

	
		
__________________________________________________________________
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-04-28 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-28 15:08 PATCH: Allow a global symbol set to common/undefined symbol Etienne Lorrain
  -- strict thread matches above, loose matches on Subject: below --
2005-04-28 14:20 Etienne Lorrain
2005-04-28 14:35 ` Daniel Jacobowitz
2005-04-26 14:24 Etienne Lorrain
2005-04-25 16:21 Binutils 2.15.97 available Etienne Lorrain
2005-04-25 18:43 ` PATCH: Allow a symbol set to common symbol + value H. J. Lu
2005-04-25 19:36   ` PATCH: Allow a global symbol set to common/undefined symbol H. J. Lu
2005-04-26  9:37     ` Etienne Lorrain
2005-04-26 13:43       ` H. J. Lu
2005-04-26 17:12     ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).