This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't use .gnu.linkonce with COMDAT


> 
> Daniel Jacobowitz wrote:
> 
> > How does this patch interact with non-GNU linkers?  This is one of the
> > problems with version-number based checks...
> 
> All the ld_vers* stuff is conditionalized on GNU ld, so I think this 
> patch would disable COMDAT for non-GNU linkers.  Julian, I suggest you 
> change it so that if $ld_vers is empty, you just set HAVE_COMDAT_GROUP 
> based on the the assembler, as is done at present.  That's no more or 
> less broken than the current state.
> 
> This bit:
> 
> + 	  memcpy (rname, ".rodata", 7);
> + 	  memcpy (rname + 7, name + 5, len - 5);
> 
> We shouldn't right "7" and such here; use strlen (".rodata"), instead. 
> GCC knows to collapse that at compile time.  And, for that matter, just 
> use strcpy; GCC knows to turn that into more efficient operations if the 
> string is known.

Why not just use strcpy and strcat?
If GCC does not optimize the strcat into a memcpy, please file a bug.

-- Pinski



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]