* som.c (som_begin_writing): Align text in all executables to
authorJeff Law <law@redhat.com>
Sun, 20 Mar 1994 17:27:51 +0000 (17:27 +0000)
committerJeff Law <law@redhat.com>
Sun, 20 Mar 1994 17:27:51 +0000 (17:27 +0000)
        make HPUX kernel happy.  Fixes strip/objcopy for shared
        executables.

bfd/ChangeLog
bfd/som.c

index ba3dc0cf2e5d1861b52aa6373d8d57407b39b5ec..1fff79b48218705d833da35d876839d7245b2a99 100644 (file)
@@ -1,3 +1,9 @@
+Sun Mar 20 09:24:36 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
+
+       * som.c (som_begin_writing): Align text in all executables to
+       make HPUX kernel happy.  Fixes strip/objcopy for shared
+       executables.
+
 Sat Mar 19 07:06:59 1994  Jeffrey A. Law  (law@snake.cs.utah.edu)
 
        * som.c (som_begin_writing): Account for alignment needs of
index f17e064899c2c88c55d5db90281260f339cf7627..a355b75f866f5057ca6674fbbe360efb00f2f230 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -2980,8 +2980,12 @@ som_begin_writing (abfd)
              /* Demand paged executables have each space aligned to a
                 page boundary.  Sharable executables (write-protected
                 text) have just the private (aka data & bss) space aligned
-                to a page boundary.  */
+                to a page boundary.  Ugh.  Not true for HPUX.
+
+                The HPUX kernel requires the text to always be page aligned
+                within the file regardless of the executable's type.  */
              if (abfd->flags & D_PAGED
+                 || (subsection->flags & SEC_CODE)
                  || ((abfd->flags & WP_TEXT)
                      && (subsection->flags & SEC_DATA)))
                current_offset = SOM_ALIGN (current_offset, PA_PAGESIZE);