Commit Graph

279 Commits

Author SHA1 Message Date
pk
f03e47e58a Calculate text size padding correctly (affects `-p' option only). 1997-04-08 23:16:27 +00:00
christos
0aad9d4378 Makefile cleanups 1997-03-24 22:02:40 +00:00
perry
48060bc2d7 Fix bug which has kept ld.so from being built for some time:
<bsd.prog.mk> was being included before an .if !defined(NOPIC)
which added rtld to the SUBDIRs. This was so that the definition
of NOPIC would get picked up. Unfortunately, this is WRONG, because
after <bsd.prog.mk> is included you shouldn't be able to touch SUBDIR
as the magic has already happened.

However, a complementary bug in the .mk files kept anyone from
noticing until now.

Fixed by moving the include of <bsd.prog.mk> to the bottom and
including <bsd.own.mk> above the .if !defined, which is the correct
way to do this sort of thing.
1997-03-24 19:54:35 +00:00
mrg
b904481502 xref ld.so.conf.5 1997-01-05 12:07:53 +00:00
scottr
372fe2ff92 Catch up with const changes to dlopen() and dlsym() prototypes in
<dlfcn.h>.  Tested on i386 and hp300 for crt0.o and ld.so, verified
other references by inspection.
1997-01-03 22:37:58 +00:00
mikel
dd40c6d884 eliminate valueless return from main(); PR bin/3073. 1997-01-03 07:10:52 +00:00
pk
c978f3a5c0 Fix another symbol mis-count noticed by Thorsten Lockert. 1996-12-28 01:11:25 +00:00
pk
db6c2ee527 <link.h> has moved in with the run-time linker source. 1996-12-23 22:13:03 +00:00
pk
f867c23217 Don't include indirect symbols in global counter if imported from a
shared library (problem noticed by Thorsten Lockert).

Also, make sure not to overwrite predefined _DYNAMIC symbol type.
1996-12-22 01:10:37 +00:00
pk
49dc4d2fe7 Deal with weak symbols when looking up in shared libraries. 1996-12-21 21:53:16 +00:00
perry
75911b347d nuke 'the the' typo 1996-12-04 00:11:23 +00:00
ws
79b6fe9805 Add machine dependent code for NetBSD/powerpc 1996-11-03 18:02:42 +00:00
pk
c51687391d Actually set the RTLD_DL flag in dlopen'ed shared objects, per PR#2791. 1996-10-06 19:03:32 +00:00
thorpej
7d468e4a0c Iff __m68k__, use a `slight hack' to determine the magic of the executable
we're doing a dynamic link for, and change the page size used for offset
and size calculations if necessary.  Allows the same ld.so to be used with
mixed m68k4k and m68k8k executables and libraries.

Thanks a million to Gordon Ross for the help in making this work!
1996-09-10 22:17:51 +00:00
thorpej
ec67ea7102 When checking the entry point of an executable, use N_PAGSIZ() rather
than __LDPGSZ directly.
1996-09-07 22:07:15 +00:00
mark
48d30b1294 Fixed NetBSD tag. 1996-08-21 18:43:29 +00:00
phil
cc13fe98cb Fix for dynamically linked functions returning structs. PR#2586/Pfaller 1996-07-31 06:22:41 +00:00
thorpej
648aed921f RCS id police. 1996-07-03 03:28:09 +00:00
jtc
e6f7d4e4c5 Add '-m' to usage string; Fixes PR #2580 1996-06-30 22:30:32 +00:00
pk
721a11bff8 Use DESTDIR to point at libraries like bsd.prog.mk does (PR#2524). 1996-06-08 22:22:26 +00:00
mark
060e1bc8f1 Initial commit of arm32 machine dependant code for ld.
Currently only supports static linking.
1996-05-17 21:51:07 +00:00
pk
46d44c05b0 Document environment variables (PR#2415).
Also correct spelling and a couple of format macros.
1996-05-15 23:46:00 +00:00
pk
8a3cf4d3fe Align BSS sections on machine dependent boundaries. The compiler/assembler
seem to not always do this for us.
1996-05-09 23:51:21 +00:00
pk
815031cee0 Look up commons in shared objects and replace the common definition if:
the so defn is data, not weak, and first class. Fixes PR#2153.
1996-03-05 22:00:30 +00:00
pk
05105a9150 Define RELOC_INIT_SEGMENT_RELOC for the ns32k (Matthias Pfaller; PR#2103). 1996-02-22 00:19:57 +00:00
pk
55d51fbb95 Relax checking of minor version number in `findhint()'. Also use the
directories from the hints (v.2) file for directory traversing.
This should take care of PR#1146.
1996-01-14 00:35:17 +00:00
pk
d6193ea4d4 Create v.2 hint files.
Note: don't bother to understand v.1 files..
1996-01-09 00:04:35 +00:00
pk
ccc1c895ef Deal with v.2 hint files (hint srch dirs not yet used). 1996-01-09 00:02:28 +00:00
pk
d98240030c Define LD_HINTS_VERSION_2:
- no longer hash on minor version number in hints file.
	- add list of ldconfig(8) search directories.
1996-01-09 00:00:11 +00:00
thorpej
2e1dc487c5 Add -fno-function-cse to PICFLAGS. Without it, Very Bad Things happen
when ld.so is compiled with gcc 2.7.2 on the m68k.  From
Niklas Hallqvist <niklas@appli.se> in PR #1557.  (Thanks, Nik, for reminding
me about this PR...)
1996-01-02 08:54:28 +00:00
pk
4162cf6459 Simplify update of r_addend field in relocation record if `-r' is on.
The old quirky code did strange things.
1995-12-28 18:04:59 +00:00
pk
2bb60e32ec Make dlopen() search for libraries if given a name of the form
`lib<name>.so[.xx[.yy]]' (per Erik M. Theisen; PR#1763; patch from PR
used in simplified form).
1995-12-28 17:57:32 +00:00
pk
35c8aad7b3 Flush after diddling text, so we get predictable results on machines
with separate I & D caches.
1995-11-28 19:29:45 +00:00
ragge
6ac54c7a78 Vax support for ld, so we (at least) can link static binaries. 1995-10-19 13:10:17 +00:00
pk
9c21bb769d Kill spaces. 1995-10-15 13:12:18 +00:00
pk
d04fcadcc2 Fix typo. 1995-10-09 09:24:59 +00:00
pk
ce77d757fd And initialize those local variables... 1995-10-09 00:14:41 +00:00
pk
9d43c41208 New style RCS IDs. 1995-10-09 00:09:39 +00:00
pk
b74b1d6456 Allow customized trace output, so ldd(1) can be more conveniently used
as a filter.

Rearrange cascading stuff: remove two-level limit.
1995-10-08 23:43:28 +00:00
pk
3aa94e17f0 Add -f option for customized output. 1995-10-08 23:39:58 +00:00
pk
b19a7d87e2 Pass on return value. 1995-09-23 22:48:18 +00:00
pk
d4fe561742 Interface version 4:
implement dlexit() (per Doug Rabson)
	get actual rtld path from crt0
	pass ld_entry back to crt0 in a better place
1995-09-23 22:46:24 +00:00
pk
fa6e06725c Define `dlexit()' in crt<=>rtld interface (active in v4). 1995-09-23 22:26:15 +00:00
pk
1a9159c7ba Check for zero sized BSS to avoid a big no-op syscall (per Mike Hibler). 1995-08-31 22:07:25 +00:00
pk
c94617858b Just use umask(0);
Use mktemp() for temporary file creation.
1995-08-25 11:35:35 +00:00
pk
4edc2f666b Ensure the hints file is readable. 1995-08-25 10:10:15 +00:00
pk
f6797ed4f1 Install the manual page. 1995-08-25 10:08:45 +00:00
pk
8920da128d Parse library names better; takes care of PR#1291 1995-08-05 00:16:36 +00:00
pk
d579c1b1db Handle object code with the "large" model PIC (eg. gcc's `-fPIC' option). 1995-08-04 21:49:00 +00:00
pk
72acb4fe30 Handle object code with the "large" model PIC (eg. gcc's `-fPIC' option). 1995-08-04 21:32:15 +00:00
pk
7787772880 Add `-R' to record internal library search paths.
Usage note: `cc -Xlinker -R<path>'.
1995-06-30 12:33:56 +00:00
pk
f42537952b man page for the run-time linker 1995-06-30 12:23:10 +00:00
pk
d8f640e15a Add a `merge' option.
Use err() & warn().
1995-06-20 23:12:33 +00:00
pk
45359beaf4 Initialise after malloc (fixes PR#1149).
Also, correct comparison when looking in `prefered' paths.
1995-06-20 23:07:03 +00:00
pk
4b7629e4ba Honour current umask when turning `x' bits on (from Joerg Wunsch). 1995-06-15 09:02:57 +00:00
pk
05a6a13e75 Be sure to calculate correct offsets in dispatch table. 1995-06-05 01:01:51 +00:00
pk
d680ed6b95 #include <dlfcn.h> 1995-06-05 00:08:38 +00:00
pk
878392000d Put dlopen() et.al. declarations in separate header file for compatibility. 1995-06-05 00:08:07 +00:00
pk
fdd7092874 Cache two more environment variable values. 1995-06-04 23:21:35 +00:00
pk
fe9497fd8c Revive library search paths. 1995-06-04 21:57:18 +00:00
pk
ad760ce3d6 Implement compiled-in library search paths: any `-L' argument encountered
while `dynamic link-mode' is on, is recorded in the executable. The
run-time linker will search these paths after $LD_LIBRARY_PATH but
before the default set and those currently in the hints file.
The feature is disabled whenever for set[ug]id programs.
1995-06-04 21:56:22 +00:00
pk
3441f631d9 Cut some convoluted code that caused library members to get pulled
in unnecessarily. Also, the size of common is of no interest if the
symbol already is in a shared object.
1995-06-04 21:33:14 +00:00
phil
46466fb2d7 Correct copyright. 1995-05-29 18:11:35 +00:00
briggs
ad2b81e4f0 jbsr takes one argument, not two. Apparently the assembler quietly
ignores the second...
Pointed out by uhenric@mcl.ucsb.edu (Henric Jungheim).
1995-05-07 13:22:12 +00:00
cgd
81584a34e6 NetBSD RCS Id format 1995-04-23 07:58:27 +00:00
pk
28dba22b40 Fix bogosities in cascade stuff. 1995-04-01 20:56:55 +00:00
pk
b05d1d15b6 Mention one more macro that was added some time ago. 1995-03-06 23:58:04 +00:00
pk
b6340cabe2 Burn LD_RUN_PATH; I didn't read the SVR5 man-pages carefully enough. 1995-03-06 22:59:10 +00:00
pk
64edf8f86f Code from Matthew Green to do DL cascading "in the first degree".
Two `fprintf(stderr, ..)' => `warnx(..)'.
1995-03-06 20:51:24 +00:00
cgd
671d2abce5 complete remove special search dirs, use NetBSD Id tag. 1995-03-06 04:24:41 +00:00
pk
9e92d48d1a Fix confusion over a.out header flags. 1995-01-29 14:47:06 +00:00
mycroft
ae92c26c4c Several consistency nits, and fix a byte order problem in md_swapout_reloc(). 1995-01-17 06:44:38 +00:00
mycroft
2c64d3be89 Several consistency nits, and don't define the get_*() macros twice. 1995-01-17 06:41:43 +00:00
pk
3e21f75b0e Don't whine about undefined symbols. 1994-12-28 10:37:38 +00:00
pk
8e0a22a5fb "weak symbol" support (fudged into `a.out' by means of the n_other field).
Weak symbols are to replace indirect (type N_INDR) symbols and will help
to clean up name spaces in libraries.

Also, some misc. bug fixes, including PR 586, and use stdio for the output
file entirely.
1994-12-23 20:32:51 +00:00
pk
da34da6096 Put a reserved field into use (weak symbol support). 1994-12-23 20:16:59 +00:00
cgd
c4c01d75b2 specify man pages the new way. 1994-12-22 09:31:26 +00:00
pk
e46ed32748 Bummer! Undo mmap() changes in rev. 1.26; they royally screw up the
kernel's pmap address preference mechanism.
1994-12-19 12:21:21 +00:00
pk
e2025017e0 Handle "/dev/zero" stuff more globally. 1994-12-18 16:05:49 +00:00
pk
b8937d605d Re-arrange mmap() calls, per Charles' suggestion. 1994-12-18 15:38:55 +00:00
pk
80a2d73dcc Don't let N_INDR entries override already defined symbols. 1994-12-17 16:22:57 +00:00
pk
524e00b29b Ensure contiguous chunks for all of an object's address space (text+data+bss). 1994-12-07 20:30:53 +00:00
mycroft
9ea7c211d9 Fix some other broken comments. 1994-12-04 08:26:22 +00:00
mycroft
ffadc8821a Remove silly comment that was causing `make depend' to barf. 1994-12-04 07:42:44 +00:00
pk
7df5d3ecf2 Another md macro to initialize a home-made struct reloc needed
for N_SET* type relocations in shared objects.
1994-11-30 18:24:56 +00:00
phil
0a13ae3ba2 patches from Matthias
new RCS id format
1994-11-30 06:20:42 +00:00
pk
e04b1df8e3 A short description of the machine dependent parts of ld/rtld. 1994-11-28 10:37:10 +00:00
pk
1f746cfba1 Prevent infinite loop on dubious input. 1994-10-30 14:18:42 +00:00
mycroft
15cea8b764 Don't close the hints file while it's mapped, but unmap and close it after
loading.
1994-10-26 20:21:42 +00:00
mycroft
e23e2b1219 Remove two unused functions. 1994-10-26 20:03:31 +00:00
mycroft
c1a45e7763 Clean this up a bit, and use the trap gate to enter the kernel. 1994-10-26 19:41:13 +00:00
cgd
4d2cbfce0a new RCS ID format. 1994-10-26 00:55:40 +00:00
pk
c13cbefe95 Recognise more symbol types when complaining. 1994-10-19 20:16:38 +00:00
pk
633e8b717d Workaround a problem with alias symbols.
Add some more symbol trace points.
1994-10-19 20:15:35 +00:00
deraadt
43965575ed NBPG --> getpagesize() 1994-09-19 16:58:18 +00:00
mycroft
72e34bc0d4 Shrink ld.so by 12k. 1994-09-19 04:49:02 +00:00
pk
c76144bbf8 Postpone allocation of linkage table offsets until pass 2.
Check for Global Offset Table overflows and, if needed, adjust the
offset range we'll use (offset 0 must always be in it).
1994-08-21 15:22:43 +00:00
pk
74920774ee init_rrs() no longer needed.
Adapt to changed flags.
1994-08-21 15:18:44 +00:00
pk
66c04ea8cb Rename some flags. 1994-08-21 15:17:00 +00:00
pk
41671de8e6 Define Global Offset Table range. 1994-08-21 15:15:43 +00:00