aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/usr.bin/ld/i386/md.c7
-rw-r--r--gnu/usr.bin/ld/ld.c5
-rw-r--r--libexec/rtld-aout/i386/md.c7
3 files changed, 13 insertions, 6 deletions
diff --git a/gnu/usr.bin/ld/i386/md.c b/gnu/usr.bin/ld/i386/md.c
index bfe12e92c11d..c0b7eba7c8d2 100644
--- a/gnu/usr.bin/ld/i386/md.c
+++ b/gnu/usr.bin/ld/i386/md.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: md.c,v 1.2 1993/10/27 00:54:58 pk Exp $
+ * $Id: md.c,v 1.2 1993/11/09 04:19:16 paul Exp $
*/
#include <sys/param.h>
@@ -96,7 +96,10 @@ md_init_header(hp, magic, flags)
struct exec *hp;
int magic, flags;
{
- N_SETMAGIC((*hp), magic, MID_I386, flags);
+ if (oldmagic)
+ hp->a_midmag = oldmagic;
+ else
+ N_SETMAGIC((*hp), magic, MID_I386, flags);
/* TEXT_START depends on the value of outheader.a_entry. */
if (!(link_mode & SHAREABLE)) /*WAS: if (entry_symbol) */
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index 00de2287cd45..5aa42345a4dc 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -32,7 +32,7 @@ static char sccsid[] = "@(#)ld.c 6.10 (Berkeley) 5/22/91";
Set, indirect, and warning symbol features added by Randy Smith. */
/*
- * $Id: ld.c,v 1.11 1993/11/05 12:47:11 pk Exp $
+ * $Id: ld.c,v 1.5 1993/11/09 04:18:56 paul Exp $
*/
/* Define how to initialize system-dependent header fields. */
@@ -1938,7 +1938,8 @@ write_header ()
{
int flags = (rrs_section_type == RRS_FULL) ? EX_DYNAMIC : 0;
- N_SET_FLAG (outheader, flags);
+ if (!oldmagic)
+ N_SET_FLAG (outheader, flags);
outheader.a_text = text_size;
outheader.a_data = data_size;
outheader.a_bss = bss_size;
diff --git a/libexec/rtld-aout/i386/md.c b/libexec/rtld-aout/i386/md.c
index bfe12e92c11d..c0b7eba7c8d2 100644
--- a/libexec/rtld-aout/i386/md.c
+++ b/libexec/rtld-aout/i386/md.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: md.c,v 1.2 1993/10/27 00:54:58 pk Exp $
+ * $Id: md.c,v 1.2 1993/11/09 04:19:16 paul Exp $
*/
#include <sys/param.h>
@@ -96,7 +96,10 @@ md_init_header(hp, magic, flags)
struct exec *hp;
int magic, flags;
{
- N_SETMAGIC((*hp), magic, MID_I386, flags);
+ if (oldmagic)
+ hp->a_midmag = oldmagic;
+ else
+ N_SETMAGIC((*hp), magic, MID_I386, flags);
/* TEXT_START depends on the value of outheader.a_entry. */
if (!(link_mode & SHAREABLE)) /*WAS: if (entry_symbol) */