PEI 16bit relocation problem -- possible fix idea

Mumit Khan khan@NanoTech.Wisc.EDU
Wed Jan 19 10:00:00 GMT 2000


Ian Lance Taylor <ian@zembu.com> writes:
> 
> It's not quite the same as XCOFF, but you probably do have to do it
> there.  The problem is that in order to set the reloc_count field of
> the asection structure correctly, you need to hook in to the code
> which sets up the asection.  That code uses set_alignment_hook, so
> it's a convenient place to hook in.  Probably that hook should be
> renamed.  For PE, it will have to check for the flag; if it is set,
> read the first relocation to get the correct count.

Ian,

Thanks for the gentle intro on how to do this!

> Note that PE already uses the set_alignment_hook for other operations,
> such as setting the alignment.  You just need to add code there.

Agreed.

> Then you'll need to patch slurp_reloc_table to skip the first
> relocation.

Ah, we don't skip the first relocation, just read the count off if
we've overflowed.

> The next trick is to set the flag and create the relocation entry on
> output.  Setting the flag would be done in coff_write_object_contents,
> I suppose.  The extra reloc would be written out in coff_write_relocs.

Regards,
Mumit


More information about the Binutils mailing list