summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_aout.c
Commit message (Collapse)AuthorAgeFilesLines
* Actually remove the a.out kld loader. While I am not 100% sure, I believepeter2002-08-291-594/+0
| | | | | it is broken. It certainly has been suffering neglect. It is not needed because we never shipped a.out kld's and they never really worked right.
* Instead of grabbing the userland a.out.h/link.h (or worse, frompeter2002-08-221-3/+5
| | | | | /usr/include!), use sys/nlist_aout.h, machine/reloc.h, sys/imgact_aout.h and sys/link_aout.h.
* In order to better support flexible and extensible access control,rwatson2002-08-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | make a series of modifications to the credential arguments relating to file read and write operations to cliarfy which credential is used for what: - Change fo_read() and fo_write() to accept "active_cred" instead of "cred", and change the semantics of consumers of fo_read() and fo_write() to pass the active credential of the thread requesting an operation rather than the cached file cred. The cached file cred is still available in fo_read() and fo_write() consumers via fp->f_cred. These changes largely in sys_generic.c. For each implementation of fo_read() and fo_write(), update cred usage to reflect this change and maintain current semantics: - badfo_readwrite() unchanged - kqueue_read/write() unchanged pipe_read/write() now authorize MAC using active_cred rather than td->td_ucred - soo_read/write() unchanged - vn_read/write() now authorize MAC using active_cred but VOP_READ/WRITE() with fp->f_cred Modify vn_rdwr() to accept two credential arguments instead of a single credential: active_cred and file_cred. Use active_cred for MAC authorization, and select a credential for use in VOP_READ/WRITE() based on whether file_cred is NULL or not. If file_cred is provided, authorize the VOP using that cred, otherwise the active credential, matching current semantics. Modify current vn_rdwr() consumers to pass a file_cred if used in the context of a struct file, and to always pass active_cred. When vn_rdwr() is used without a file_cred, pass NOCRED. These changes should maintain current semantics for read/write, but avoid a redundant passing of fp->f_cred, as well as making it more clear what the origin of each credential is in file descriptor read/write operations. Follow-up commits will make similar changes to other file descriptor operations, and modify the MAC framework to pass both credentials to MAC policy modules so they can implement either semantic for revocation. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-4/+3
| | | | reference.
* Since we used '#ifdef __i386__', don't close with '#endif /* !__alpha__ */'dfr2001-11-241-1/+1
|
* Fix a number of misspellings of "dependency" and "dependencies" iniedowse2001-11-161-1/+1
| | | | | | | comments and function names. PR: kern/8589 Submitted by: Rajesh Vaidheeswarran <rv@fore.com>
* KSE Milestone 2julian2001-09-121-6/+7
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* Manually add an extra _ to _DYNAMIC since it is provided by ld, not gcc.peter2001-02-251-3/+3
| | | | Make the rest compile.
* Change the conditionaal so that we only build this on i386 instead ofdfr2000-09-291-1/+1
| | | | trying to build it on all non-alpha arches.
* Move the truncation code out of vn_open and into the open system callmckusick2000-07-041-2/+3
| | | | | | | | | | after the acquisition of any advisory locks. This fix corrects a case in which a process tries to open a file with a non-blocking exclusive lock. Even if it fails to get the lock it would still truncate the file even though its open failed. With this change, the truncation is done only after the lock is successfully acquired. Obtained from: BSD/OS
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* First round implementation of a fine grain enhanced module to modulepeter2000-04-291-77/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | version dependency system. This isn't quite finished, but it is at a useful stage to do a functional checkpoint. Highlights: - version and dependency metadata is gathered via linker sets, so things are handled the same for static kernels and code built to live in a kld. - The dependencies are at module level (versus at file level). - Dependencies determine kld symbol search order - this means that you cannot link against symbols in another file unless you depend on it. This is so that you cannot accidently unload the target out from underneath the ones referencing it. - It is flexible enough that we can put tags in #include files and macros so that we can get decent hooks for enforcing recompiles on incompatable ABI changes. eg: if we change struct proc, we could force a recompile for all kld's that reference the proc struct. - Tangled dependency references at boot time are sorted. Files are relocated once all their dependencies are already relocated. Caveats: - Loader support is incomplete, but has been worked on seperately. - Actual enforcement of the version number tags is not active yet - just the module dependencies are live. The actual structure of versioning hasn't been agreed on yet. (eg: major.minor, or whatever) - There is some backwards compatability for old modules without metadata but I'm not sure how good it is. This is based on work originally done by Boris Popov (bp@freebsd.org), but I'm not sure he'd recognize much of it now. Don't blame him. :-) Also, ideas have been borrowed from Mike Smith.
* * Rewrite to use kobj(9) instead of hard-coded function tables.dfr2000-04-241-77/+69
| | | | | | | * Report link errors to stdout with uprintf() so that the user can see what went wrong (PR kern/9214). * Add support code to allow module symbols to be loaded into GDB using the debugger's "sharedlibrary" command.
* Fixed a cast of a pointer to an integer of a possibly different size.bde1999-12-241-2/+2
| | | | | Fixed casts of non-`void *' pointers to uintptr_t. Fixed related style bugs. This file uses perfectly non-KNF formatting for casts.
* Change incorrect NULLs to 0seivind1999-12-211-1/+1
|
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-0/+3
|
* Take a shot at implementing the fix for PR 15014 for the a.out kernelpeter1999-11-281-4/+6
| | | | | | | linker as well. PR: 15014 Submitted by: Vladimir N. Silyaev <vns@delta.odessa.ua>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add enough include files to make this actually compile on an a.out system.eivind1999-05-151-1/+8
|
* Use KERNBASE for the load address of the kernel rather than magic constantspeter1999-05-081-6/+3
| | | | as it seems to work.. (at least on i386/elf).
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-281-8/+8
| | | | kernel compile
* Don't try to call SYSUNINIT functions if there was a link error.dfr1999-01-251-1/+4
| | | | Reviewed by: Peter Wemm <peter@netplex.com.au>
* The handle for the kernel is common. With this fix, ELF kernels can loadpeter1998-11-041-10/+5
| | | | a.out kld modules, and a.out kernels can load ELF kld modules.
* Initialize the a.out kld loader after elf, so that elf gets first shot atpeter1998-11-031-2/+2
| | | | a kldload attempt.
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-251-2/+1
| | | | about unused variables, labels and other lint.
* Fix some bugs in link_aout.c caused by using uninitialized malloc space.peter1998-10-161-1/+4
| | | | Pre-Approved by: jkh
* Updates for KLD backends.peter1998-10-091-34/+102
| | | | | | | | | | | | | | | - symbol_values checks that the symbol is indeed belonging to the correct symbol and string table pairs before looking up. (since there could be many pairs, and KLD/DDB need to find out). - different ops for files versus preload modules - the unload mechanism is different. (a preloaded module has to be deleted on unload since the in-core image is tainted by relocation and variables used) - Do not build an a.out kernel module if we're running on an elf kernel. :-) Note that it should theoretically be possible to mix a.out and elf KLD modules providing -mno-underscores was used to compile it, or some other symbol conversion takes place. - Support preload modules (even though /boot/loader doesn't yet) - Search the module path when loading files.
* Avoid a possible memory leak.dfr1998-09-111-2/+8
|
* Make ELF kernels build again.jdp1998-08-161-1/+3
|
* Use [u]intptr_t instead of [u_]long for casts between pointers andbde1998-08-161-2/+2
| | | | integers. Don't forget to cast to (void *) as well.
* Modify the internal interfaces to the kernel linker to make it possibledfr1998-08-121-8/+69
| | | | for DDB to use its symbol tables.
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-4/+4
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* Don't depend on gcc's feature of casting lvalues.bde1998-07-071-2/+3
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-1/+6
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Fixed a sloppy common-style definitions.bde1997-11-201-1/+8
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-5/+1
| | | | Found by: -Wunused
* make a couple functions static...jmg1997-10-241-3/+3
| | | | | also change module_register_static to module_register_init as this function initalizes the module for both dynamic and static modules...
* Removed unused #includes.bde1997-08-021-7/+1
|
* This is the kernel linker. To use it, you will first need to applydfr1997-05-071-0/+448
the patches in freefall:/home/dfr/ld.diffs to your ld sources and set BINFORMAT to aoutkld when linking the kernel. Library changes and userland utilities will appear in a later commit.
OpenPOWER on IntegriCloud