DJGPP and alignment
John Marshall
John_W_Marshall@palm.com
Thu Jul 22 08:23:00 GMT 1999
Richard Henderson writes:
> I fear you're getting yourself into trouble, since there's no
> way to change the section alignment in coff.
Yeah. I've just found this out the long hard way.
I've been adding a collect-sections-to-make-data kind of thing to
m68kcoff (it does the same sort of job as .rel.sdata in mipsecoff:
loadtime relocations for data sections). My data is 10 byte records.
It seems I have three choices:
1. Admit defeat and pad each record to 12 bytes.
2. Override coff_new_section_hook like in coff-sh.c.
3. Add yet another special case for my little section to
coff_new_section_hook in coffcode.h.
Is there any advice as to the "right way"? At the moment I'm using #2,
but it feels like overkill, and, for a bfd neophyte like me, it took ages
to figure out. I feel like maybe the "spirit of coff" is #1.
(Also BTW:
Mark E writes:
> But coff_new_section_hook doesn't mention .idata, perhaps you meant
> coff_set_alignment_hook?
I also found out the long hard way that coff_set_alignment_hook only
applies when reading in a bfd file. If you want special alignment
handling for sections created in the linker, I think you want
coff_new_section_hook. But maybe this isn't your situation.)
John
More information about the Binutils
mailing list