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: Discussion about merging Go frontend


On 30/10/2010 01:23, Richard Henderson wrote:

>> +  if (!objfile_internal_read (objfile->descriptor,
>> +			      objfile->offset + eor->shoff + shdr_size,
>> +			      shdrs,
>> +			      shdr_size * (shnum - 1),
>> +			      &errmsg, err))
> 
> Do we really want to keep re-reading section data for every section
> lookup we do?  Can't we do this in objfile_open_read?

  It should only be necessary to do one section lookup per object file anyway.
 Keep extra data hanging around in memory in the backend just so that we can
write algorithmically inefficient code in the client?  Seems like a bad
tradeoff to me!

>> +  set_32 (hdr + offsetof (struct external_scnhdr, s_flags),
>> +	  (STYP_DATA | IMAGE_SCN_ALIGN_1BYTES | IMAGE_SCN_MEM_DISCARDABLE
>> +	   | IMAGE_SCN_MEM_SHARED | IMAGE_SCN_MEM_READ));
> 
> You're not recording alignment in the coff object file?

  It looks to me like he's recording an alignment of 1 byte.

> IMAGE_SCN_ALIGN_<N>BYTES, 1 <= N <= 8192, are all defined
> with a simple function in that nibble.

  The line you quoted uses IMAGE_SCN_ALIGN_1BYTES.  That's all we'll ever need
for LTO sections.

    cheers,
      DaveK


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