under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.
Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.
Tested on: i386 (extensively), alpha
noting that the restrictions do not apply if the user invoking the
program is also the owner of the program.
Also, capitalize a section header properly.
PR: misc/41180
It does not help modern compilers, and some may take some hit from it.
(I also found several functions that listed *every* of its 10 local vars with
"register" -- just how many free registers do people think machines have?)
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.
This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.
directories in addition to world-writable directories. As before,
this check can be disabled with the "-i" option, which in turn can
be made the default for boot-up by setting "ldconfig_insecure=YES"
in "/etc/rc.conf".
Also fix an mdoc nit in the manual page.
Submitted by: Maxime Henrion <mux@qualys.com>
and emit a warning. This is a security measure since ldconfig
influences the shared libraries used by all programs.
I think the check should be made even more stringent by also
ignoring group-writable directories. I will make that change soon
unless we encounter a good reason not to do it.
Submitted by: Maxime Henrion <mhenrion@cybercable.fr>
standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an
indication of the user's preferred object file format. This
consolidates some code that was starting to be duplicated in more
and more places.
Use the new function in ldconfig.
Note: I don't think that gcc should use getobjformat(), even though
it could. The compiler should limit itself to functions that are
widespread, to ease porting and cross-compilation.
MAP_FAILED.
Don't try to extend the mapping in place if it is too short.
There's no guarantee it will be possible. Remap the file instead.
Put in a few style fixes.
Submitted by: Bruce Evans <bde>
a different file than the a.out hints, namely, "/var/run/ld-elf.so.hints".
These hints consist only of the directory search path. There is
no hash table as in the a.out hints, because ELF doesn't have to
search for the file with the highest minor version number. (It
doesn't have minor version numbers at all.)
A single run of ldconfig updates either the a.out hints or the ELF
hints, but not both. The set of hints to process is selected in
the usual way, via /etc/objformat, or ${OBJFORMAT}, or the "-aout"
or "-elf" command line option. The rationale is that you probably
want to search different directories for ELF than for a.out.
"ldconfig -r" is faked up to produce output like we are used to,
except that for ELF there are no minor version numbers. This should
enable "ldconfig -r" to be used for checking LIB_DEPENDS in ports
even for ELF.
I implemented the ELF functionality in a new source file, with an
eye toward eliminating the a.out code entirely at some point in
the future.
Move a.out libraries to /usr/lib/aout to make space for ELF libs.
Make rtld usr /usr/lib/aout as default library path.
Make ldconfig reject /usr/lib as an a.out library path.
Fix various Makefiles for LIBDIR!=/usr/lib breakage.
This will after a make world & reboot give a system that no
longer uses /usr/lib/*, infact one could remove all the old
libraries there, they are not used anymore.
We are getting close to an ELF make world, but I'll let this
all settle for a week or two...
confused when they can't find it), but leave the reference to it
as being a standard filename (which doesn't imply that it exists).
Discussed with: jkh
file based on the previous list of directories stored there which
should overcome a weakness of the '-m' switch which can only add
libs. This is an ideal way of updating the hints list after adding
or removing a shlib since it will remove entries that are gone and
doesn't need to have all the directories spelled out each time.
(eg: rm -f /usr/lib/libtcl75*; ldconfig -R) This only works for
version 2 hints files (which we've been generating for a year or
so) which store the path.
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
that is stored in the hints file. If that search path contained
a non-existent directory (one, say, that had been removed), and
"ldconfig -m /a/perfectly/good/directory" was run, ldconfig returned
an error status without printing an error message. This caused
some confusing bombs when installing ports, in particular.
I changed it so that non-existent directories from the stored search
path are silently ignored. Only non-existent directories named
explicitly on the command line are treated as errors. Also, a
diagnostic is printed if and only if an error status is returned.
In an unrelated fix, ldconfig now silently ignores any directories
named on the command line when the "-r" option is given. Formerly,
these directories incorrectly made their way into the "search
directories" line of the listing. It really should be an error to
specify directories together with "-r", but I don't have time to
fix the manual page in that way right now.
2.2 Candidate.
ldconfig path (from NetBSD). I added code to make sure there were no
duplicates in the path when multiple ldconfig -m's were used.
Reviewed by: nate, jdp
Obtained from: NetBSD (partly)
man pages up to mdoc guidelines and fix some minor formatting glitches.
Also fixed a number of man pages to not abuse the .Xr macro to
display functions and path names and a lot of other junk.
This solves the problem of being unable to use shared libraries with dots
in their names before the ".so.<version>" code.
This should be brought into -stable.
There are more changes from Paul that look like they should be included,
but they change the format of the hints file, so I'm not going to bring them
in now (but we should in the future).
Obtained from: pk@netbsd.org