diff -rc src/bfd/coffcode.h.org src/bfd/coffcode.h
*** src/bfd/coffcode.h.org	Mon Nov 12 17:47:04 2001
--- src/bfd/coffcode.h	Tue Nov 13 05:40:48 2001
***************
*** 412,417 ****
--- 412,425 ----
      {
        styp_flags = STYP_LOADER;
      }
+   else if (!strcmp (sec_name, _EXCEPT))
+     {
+       styp_flags = STYP_EXCEPT;
+     }
+   else if (!strcmp (sec_name, _TYPCHK))
+     {
+       styp_flags = STYP_TYPCHK;
+     }
  #endif
    /* Try and figure out what it should be */
    else if (sec_flags & SEC_CODE)
***************
*** 2470,2478 ****
  	{
  	  /* make sure this section is aligned on the right boundary - by
  	     padding the previous section up if necessary */
! 
  	  old_sofar = sofar;
! 	  sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
  	  if (previous != (asection *) NULL)
  	    {
  	      previous->_raw_size += sofar - old_sofar;
--- 2478,2516 ----
  	{
  	  /* make sure this section is aligned on the right boundary - by
  	     padding the previous section up if necessary */
! 	  
  	  old_sofar = sofar;
! 
! #ifdef RS6000COFF_C
! 	  /* AIX loader checks the text section alignment of (vma - filepos)
! 	     So even though the filepos may be aligned wrt the o_algntext, for
! 	     AIX executables, this check fails. This shows up when an native 
! 	     AIX executable is stripped with gnu strip because the default vma
! 	     of native is 0x10000150 but default for gnu is 0x10000140.  Gnu
! 	     stripped gnu excutable passes this check because the filepos is 
! 	     0x0140. */
! 	  if (!strcmp (current->name, _TEXT)) 
! 	    {
! 	      bfd_vma pad;
! 	      bfd_vma align;
! 
! 	      sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
! 
! 	      align = 1 << current->alignment_power;
! 	      pad = abs (current->vma - sofar) % align;
! 	      
! 	      if (pad) 
! 		{
! 		  pad = align - pad;
! 		  sofar += pad;
! 		}
! 	    }
! 	  else
! #else
! 	    {
! 	      sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
! 	    }
! #endif
  	  if (previous != (asection *) NULL)
  	    {
  	      previous->_raw_size += sofar - old_sofar;
diff -rc src/include/coff/xcoff.h.org src/include/coff/xcoff.h
*** src/include/coff/xcoff.h.org	Mon Nov 12 17:46:44 2001
--- src/include/coff/xcoff.h	Mon Nov 12 21:21:31 2001
***************
*** 34,39 ****
--- 34,41 ----
  #define _BSS	".bss"
  #define _PAD	".pad"
  #define _LOADER	".loader"
+ #define _EXCEPT ".except"
+ #define _TYPCHK ".typchk"
  
  /* XCOFF uses a special .loader section with type STYP_LOADER.  */
  #define STYP_LOADER 0x1000
***************
*** 44,49 ****
--- 46,60 ----
  /* XCOFF handles line number or relocation overflow by creating
     another section header with STYP_OVRFLO set.  */
  #define STYP_OVRFLO 0x8000
+ 
+ /* Specifies an exception section.  A section of this type provides 
+    information to identify the reason that a trap or ececptin occured within 
+    and executable object program */
+ #define STYP_EXCEPT 0x0100
+ 
+ /* Specifies a type check section.  A section of this type contains parameter 
+    argument type check strings used by the AIX binder.  */
+ #define STYP_TYPCHK 0x4000
  
  #define	RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */
  #define	RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */


