aboutsummaryrefslogtreecommitdiff
path: root/lib/csu
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1994-01-03 18:35:54 +0000
committerDavid Greenman <dg@FreeBSD.org>1994-01-03 18:35:54 +0000
commit1799d2585ecb457a29b7c271af4fb78017ed75d0 (patch)
tree843f2ac107662b253aa7c4a7f07018e0e2daae40 /lib/csu
parent504c39bf88611341e311d1c92de19b0d748e24e1 (diff)
downloadsrc-1799d2585ecb457a29b7c271af4fb78017ed75d0.tar.gz
src-1799d2585ecb457a29b7c271af4fb78017ed75d0.zip
Implemented 'QMAGIC' a.out format correctly, and changed the default
output to be QMAGIC.
Notes
Notes: svn path=/head/; revision=928
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/i386/crt0.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c
index fdbe2c8a9bdf..02700106463c 100644
--- a/lib/csu/i386/crt0.c
+++ b/lib/csu/i386/crt0.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: crt0.c,v 1.8 1993/11/04 10:51:41 pk Exp $
+ * $Id: crt0.c,v 1.6 1993/11/09 04:26:11 paul Exp $
*/
@@ -264,7 +264,7 @@ __do_dynamic_link ()
if (read(crt.crt_ldfd, &hdr, sizeof hdr) < sizeof hdr) {
_FATAL("Failure reading ld.so\n");
}
- if (N_GETMAGIC(hdr) != ZMAGIC) {
+ if ((N_GETMAGIC_NET(hdr) != ZMAGIC) && (N_GETMAGIC(hdr) != QMAGIC)) {
_FATAL("Bad magic: ld.so\n");
}
@@ -287,7 +287,7 @@ __do_dynamic_link ()
#endif
/* Map in ld.so */
- crt.crt_ba = mmap(0, hdr.a_text+hdr.a_data+hdr.a_bss,
+ crt.crt_ba = mmap(0, hdr.a_text,
PROT_READ|PROT_EXEC,
MAP_FILE|MAP_COPY,
crt.crt_ldfd, N_TXTOFF(hdr));
@@ -308,7 +308,7 @@ __do_dynamic_link ()
/* Map in data segment of ld.so writable */
if (mmap(crt.crt_ba+N_DATADDR(hdr), hdr.a_data,
- PROT_READ|PROT_EXEC|PROT_WRITE,
+ PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_FILE|MAP_COPY,
crt.crt_ldfd, N_DATOFF(hdr)) == -1) {
_FATAL("Cannot map ld.so\n");
@@ -316,7 +316,7 @@ __do_dynamic_link ()
/* Map bss segment of ld.so zero */
if (hdr.a_bss && mmap(crt.crt_ba+N_BSSADDR(hdr), hdr.a_bss,
- PROT_READ|PROT_EXEC|PROT_WRITE,
+ PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_ANON|MAP_COPY,
crt.crt_dzfd, 0) == -1) {
_FATAL("Cannot map ld.so\n");