]> code.delx.au - gnu-emacs/blobdiff - src/unexelf.c
Version 3.15
[gnu-emacs] / src / unexelf.c
index b3075f08b2f6e72d8768637fd682d4339578b1f6..ee563b36a9701e3ae86db59b98b33cc646348db2 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1985,86,87,88,90,92,1999,2000,01,2003
-   Free Software Foundation, Inc.
+/* Copyright (C) 1985, 1986, 1987, 1988, 1990, 1992, 1999, 2000, 2001,
+                 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -15,8 +15,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.
 
 In other words, you are welcome to use, share and improve this program.
 You are forbidden to forbid anyone else to use, share and improve
@@ -950,8 +950,13 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
        }
       else
        {
-         /* Any section that was original placed AFTER the bss
-            section should now be off by NEW_DATA2_SIZE. */
+         /* Any section that was originally placed after the .bss
+            section should now be off by NEW_DATA2_SIZE.  If a
+            section overlaps the .bss section, consider it to be
+            placed after the .bss section.  Overlap can occur if the
+            section just before .bss has less-strict alignment; this
+            was observed between .symtab and .bss on Solaris 2.5.1
+            (sparc) with GCC snapshot 960602.  */
 #ifdef SOLARIS_POWERPC
          /* On PPC Reference Platform running Solaris 2.5.1
             the plt section is also of type NOBI like the bss section.
@@ -965,9 +970,8 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
              >= OLD_SECTION_H (old_bss_index-1).sh_offset)
            NEW_SECTION_H (nn).sh_offset += new_data2_size;
 #else
-         if (round_up (NEW_SECTION_H (nn).sh_offset,
-                       OLD_SECTION_H (old_bss_index).sh_addralign)
-             >= new_data2_offset)
+         if (NEW_SECTION_H (nn).sh_offset + NEW_SECTION_H (nn).sh_size
+             > new_data2_offset)
            NEW_SECTION_H (nn).sh_offset += new_data2_size;
 #endif
          /* Any section that was originally placed after the section
@@ -1280,3 +1284,6 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
   if (chmod (new_name, stat_buf.st_mode) == -1)
     fatal ("Can't chmod (%s): errno %d\n", new_name, errno);
 }
+
+/* arch-tag: e02e1512-95e2-4ef0-bba7-b6bce658f1e3
+   (do not change this comment) */