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: DJGPP and alignment


I don't know whether this applies to you guys or not, because
I don't know much about DJGPP, but when I did something similar
for Interix, I found that there was one other required change:
certain sections assume that they are 4 byte aligned, and a
specific override for them is required.  In my case, there's
a test in coff_new_section_hook in coffcode.h that looks to
see if the section is .stabs (etc.) and on NT I had to add
the .idata section to the list.  (I also had to add .pdata,
but that doesn't apply to x86 architectures.)

Hope this is useful, but recognize it might not be relevant.

Donn

Mark E. wrote:
> 
> 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/
> 
> *** bfd/coff-go32.new   Wed Jul 21 11:56:50 1999
> --- bfd/coff-go32.c     Wed Jul 21 11:52:44 1999
> *************** Foundation, Inc., 59 Temple Place - Suit
> *** 21,26 ****
> --- 21,27 ----
>   #define TARGET_SYM            go32coff_vec
>   #define TARGET_NAME           "coff-go32"
>   #define TARGET_UNDERSCORE     '_'
> + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (4)
>   #define COFF_LONG_SECTION_NAMES
>   #define COFF_SUPPORT_GNU_LINKONCE
> 
> *** coff-i386.c 1999/07/19 14:55:15     1.3
> --- coff-i386.c 1999/07/21 15:58:14
> *************** static reloc_howto_type *coff_i386_rtype
> *** 45,51 ****
> --- 45,54 ----
> 
>            bfd_vma *));
> 
> + #ifndef COFF_DEFAULT_SECTION_ALIGNMENT_POWER
>   #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2)
> + #endif
> +
>   /* The page size is a guess based on ELF.  */
> 
>   #define COFF_PAGE_SIZE 0x1000
> *** bfd/coff-go32.new   Wed Jul 21 11:56:50 1999
> --- bfd/coff-go32.c     Wed Jul 21 12:02:36 1999
> ***************
> *** 1,5 ****
>   /* BFD back-end for Intel 386 COFF files (go32 variant).
> !    Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation,
> Inc.
>      Written by DJ Delorie.
> 
>   This file is part of BFD, the Binary File Descriptor library.
> --- 1,5 ----
>   /* BFD back-end for Intel 386 COFF files (go32 variant).
> !    Copyright 1990, 1991, 1992, 1993, 1994, 1999 Free Software
> Foundation, Inc.
>      Written by DJ Delorie.
> 
>   This file is part of BFD, the Binary File Descriptor library.
> *************** Foundation, Inc., 59 Temple Place - Suit
> *** 21,26 ****
> --- 21,27 ----
>   #define TARGET_SYM            go32coff_vec
>   #define TARGET_NAME           "coff-go32"
>   #define TARGET_UNDERSCORE     '_'
> + #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (4)
>   #define COFF_LONG_SECTION_NAMES
>   #define COFF_SUPPORT_GNU_LINKONCE
> 

-- 

===================================================
Donn Terry                  mailto:donn@interix.com
Softway Systems, Inc.        http://www.interix.com
2850 McClelland Dr, Ste. 1800   Ft.Collins CO 80525
Tel: +1-970-204-9900           Fax: +1-970-204-9951
===================================================

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