]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change text alignement to 4 bytes.
authorTom Rix <trix@redhat.com>
Wed, 12 Jun 2002 16:04:39 +0000 (16:04 +0000)
committerTom Rix <trix@redhat.com>
Wed, 12 Jun 2002 16:04:39 +0000 (16:04 +0000)
bfd/ChangeLog
bfd/coff-rs6000.c
bfd/coffcode.h

index fd439709c0ff1fe67e3705e1d3f81fbe422edac9..38f19f1230cae1592bc434f43511a11717f52ab1 100644 (file)
@@ -1,3 +1,14 @@
+2002-06-11  Tom Rix  <trix@redhat.com>
+
+       * coffcode.h (coff_compute_section_file_positions): Add data
+       section to AIX loader alignment check.
+
+       * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section 
+       alignment to 4 bytes.
+       (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment
+       power accessor macro.
+       (do_shared_object_padding): Remove invalid assertion.
+
 2002-06-10  Richard Sandiford  <rsandifo@redhat.com>
 
        * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE
index 7cd26b88ffd4797d1fef60ca0721e418ec9f717e..a18aa5e9054abff77dc4baa111b4e70d4f527fce 100644 (file)
@@ -237,7 +237,7 @@ _bfd_xcoff_mkobject (abfd)
   xcoff_data (abfd)->debug_indices = NULL;
 
   /* text section alignment is different than the default */
-  /* xcoff_data (abfd)->text_align_power = 5; */
+  bfd_xcoff_text_align_power (abfd) = 2;
 
   return true;
 }
@@ -278,8 +278,8 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd)
       else
        ox->snentry = sec->output_section->target_index;
     }
-  ox->text_align_power = ix->text_align_power;
-  ox->data_align_power = ix->data_align_power;
+  bfd_xcoff_text_align_power (obfd) = bfd_xcoff_text_align_power (ibfd);
+  bfd_xcoff_data_align_power (obfd) = bfd_xcoff_data_align_power (ibfd);
   ox->modtype = ix->modtype;
   ox->cputype = ix->cputype;
   ox->maxdata = ix->maxdata;
@@ -1730,7 +1730,6 @@ do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size)
       int text_align_power;
 
       text_align_power = bfd_xcoff_text_align_power (in_bfd);
-      BFD_ASSERT (2 < text_align_power);
 
       pad = 1 << text_align_power;
       pad -= (*offset + ar_header_size) & (pad - 1);
index ece19a2ecad6728eabaf481b53f76ce153055deb..0363bb7b364aa56e8e62a21233a25f64caef243f 100644 (file)
@@ -1782,8 +1782,8 @@ coff_mkobject_hook (abfd, filehdr, aouthdr)
       xcoff->toc = internal_a->o_toc;
       xcoff->sntoc = internal_a->o_sntoc;
       xcoff->snentry = internal_a->o_snentry;
-      xcoff->text_align_power = internal_a->o_algntext;
-      xcoff->data_align_power = internal_a->o_algndata;
+      bfd_xcoff_text_align_power (abfd) = internal_a->o_algntext;
+      bfd_xcoff_data_align_power (abfd) = internal_a->o_algndata;
       xcoff->modtype = internal_a->o_modtype;
       xcoff->cputype = internal_a->o_cputype;
       xcoff->maxdata = internal_a->o_maxdata;
@@ -3084,8 +3084,10 @@ coff_compute_section_file_positions (abfd)
             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)) 
+            0x0140.  This problem also show up with 64 bit shared objects. The
+            data section must also be aligned.  */
+         if (!strcmp (current->name, _TEXT) 
+             || !strcmp (current->name, _DATA)) 
            {
              bfd_vma pad;
              bfd_vma align;