public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: DJGPP and alignment
@ 1999-07-21  9:57 Mark E.
  0 siblings, 0 replies; 17+ messages in thread
From: Mark E. @ 1999-07-21  9:57 UTC (permalink / raw)
  To: binutils

> Note for coff-go32.c I made the attached patch relative to my last one.
> 

D'oh! Forgot the ChangeLog for BFD:

1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>

* coff-go32.c (COFF_DEFAULT_SECTION_ALIGNMENT_POWER): 
Define to 4.
* coff-i386.c: Define 
COFF_DEFAULT_SECTION_ALIGNMENT_POWER only if not already 
defined.

--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: DJGPP and alignment
@ 1999-07-22 11:32 Mark E.
  0 siblings, 0 replies; 17+ messages in thread
From: Mark E. @ 1999-07-22 11:32 UTC (permalink / raw)
  To: binutils

> > Or it would if .ctors and .dtors were not specially handled in
> > coff_new_section_hook in coffcode.h.  So you're OK on constructors and
> > destructors if you do indeed use the section names .ctors and .dtors.
> > 

How about a new define just for the alignment of the .data and .text 
sections (so it can be set to our desired 16 bytes) and let the current 
alignment flag be used for all other sections. Does sound safe 
enough?

Mark

--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: DJGPP and alignment
@ 1999-07-22  8:23 John Marshall
  1999-07-22 11:53 ` Ian Lance Taylor
  0 siblings, 1 reply; 17+ messages in thread
From: John Marshall @ 1999-07-22  8:23 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 17+ messages in thread
* DJGPP and alignment
@ 1999-07-21  9:07 Mark E.
  1999-07-21  9:31 ` Donn Terry
  1999-07-21 11:47 ` Richard Henderson
  0 siblings, 2 replies; 17+ messages in thread
From: Mark E. @ 1999-07-21  9:07 UTC (permalink / raw)
  To: binutils

Hello again,
A consensus of the DJGPP workers has decided that the default 
alignment should be 16 bytes instead of the current 4 bytes since 16 is 
the recommended Intel alignment.

Do I need another to handle the non-BFD case or does this one cover 
it?

Note for coff-go32.c I made the attached patch relative to my last one.

Mark

--- 
Mark Elbrecht, snowball3@bigfoot.com
http://snowball.frogspace.net/

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~1999-07-22 14:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-21  9:57 DJGPP and alignment Mark E.
  -- strict thread matches above, loose matches on Subject: below --
1999-07-22 11:32 Mark E.
1999-07-22  8:23 John Marshall
1999-07-22 11:53 ` Ian Lance Taylor
1999-07-22 13:34   ` Mark E.
1999-07-22 14:37     ` Ian Lance Taylor
1999-07-21  9:07 Mark E.
1999-07-21  9:31 ` Donn Terry
1999-07-21 17:30   ` Mark E.
1999-07-21 11:47 ` Richard Henderson
1999-07-21 17:30   ` Mark E.
1999-07-21 17:35     ` Ian Lance Taylor
1999-07-21 20:23       ` Donn Terry
1999-07-22  0:13         ` Ian Lance Taylor
1999-07-21 21:51       ` Mark E.
1999-07-22  1:10     ` Eli Zaretskii
1999-07-22  6:08       ` Mark E.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).