This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: (fixed patch) pe-dll fix for exporting common symbols


Ian Lance Taylor <ian@zembu.com> writes:
>    Date: Thu, 24 Jun 1999 14:43:05 -0500
>    From: Mumit Khan <khan@xraylith.wisc.EDU>
> 
>    +          if (blhe->type == bfd_link_hash_defined)
>    +	    {
>    +	      exported_symbol_offsets[i] = blhe->u.def.value;
>    +	      exported_symbol_sections[i] = blhe->u.def.section;
>    +	    }
>    +	  else
>    +	    {
>    +	      exported_symbol_offsets[i] = 0;
>    +	      exported_symbol_sections[i] = blhe->u.c.p->section;
>    +	    }
> 
> I don't know how PE handles common symbols in DLLs, but I don't see
> how this could be right.  This appears to assume that the common
> symbol is at the start of the section, but that is not correct.  You
> can have multiple common symbols in a single section.  Try putting
> several common symbols in a single input file, and see what happens.

Yeah, it's completely bogus. Please pretend I never sent it in ;-)

Turns out that the offset value for common variables is *always* 16
no matter what the type is and how many there. So either way, I was
overwriting the values by unintended means.

I have yet to figure out how bfd is laying out common symbols, and how
I can access the info to write out the offsets into bss/common section.

Regards,
Mumit


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