Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Mar 2002 00:02:08 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        "M. Warner Losh" <imp@village.org>, current@FreeBSD.org, peter@FreeBSD.org
Subject:   Re: stdout changes break some ports
Message-ID:  <3CA6C280.F41FBB55@mindspring.com>
References:  <20020324173513.A75429@xor.obsecurity.org> <20020324.184313.30925676.imp@village.org> <20020324175436.A75804@xor.obsecurity.org> <20020330224648.A93819@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kennaway wrote:
> How does one fix this in a library?  I've been moving the
> initialization to main() for applications.

Use assembly glue to put it in a linker set that gets pulled
in by the .init code.

This will only work for user space code, since it depends in
the crt0 treating it like a C++ binary (linker sets are a C++
feature which FreeBSD uses all over anyway).

I'm not totally convinced this is really the way to fix this,
since I'm not totally convinced that this isn't an introduced
problem, rather than a real problem (e.g. perhaps the stdio
changes were not completely and totally well thought out, if
how to handle this problem wasn't part of the changes).

If it's now a requirement, it's very tempting to put the code
in the entry code, before it even calls "main" (e.g. in crt0
proper, rather than in a linker set crt0 knows about).

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CA6C280.F41FBB55>