Commit Graph

348 Commits

Author SHA1 Message Date
pk
795c860f6a The PLT symbol is also a special case when processing a shared library
symbol table (and so is the GOT symbol actually, but no one ever noticed..).

Re-enable PLT symbol.
1998-09-04 09:43:29 +00:00
matt
24d4c63088 Disable the the PLT symbol until I can get it to work properly. 1998-09-03 19:17:10 +00:00
matt
81c6c6b8c6 Fix core dump when plt_symbol didn't exist when needed with dynamic images. 1998-08-28 14:45:46 +00:00
matt
c75dbabbf6 only emit __PROCEDURE_LINKAGE_TABLE_ if generating shared library. 1998-08-27 21:20:44 +00:00
matt
60f624ddb7 Fix some obvious bugs. 1998-08-26 15:32:02 +00:00
matt
2ffec21522 Create symbol for __PROCEDURE_LINKAGE_TABLE_. 1998-08-26 14:39:47 +00:00
matt
4da3f7cfd8 Add external symbol for __PROCEDURE_LINKAGE_TABLE_. Modify arguments
to md_make_gotreloc for VAX'es sake.
1998-08-26 14:37:40 +00:00
matt
fb6da63fa6 More changes for shareable libraries and PIC code 1998-08-21 01:03:48 +00:00
matt
0111660e53 Get md.c to compile again. Get mdprologue.S to assemble. [Now at least
ld and rtld compile and link.]
1998-08-20 15:12:02 +00:00
matt
74018d8df6 Untested(!!) beginning of VAX a.out shared library support. This is a work
in progress.
1998-08-18 18:46:16 +00:00
mycroft
93f8d753f8 Small changes to make debugging a little easier. 1998-08-13 07:34:05 +00:00
mycroft
41a070136b When DEBUG, log init and fini calls. 1998-08-06 00:03:28 +00:00
mycroft
9ae60c44af More cruft. 1998-08-05 04:25:03 +00:00
mycroft
7625579cb3 GC some cruft. 1998-08-05 04:21:51 +00:00
mycroft
5d231ae38e Don't reset the reloc_index when we patch a jmpslot. We don't need to, and
this kluges around some cache issues.
1998-07-27 07:48:21 +00:00
ross
d26b3c59c1 Elaborate on --export-dynamic somewhat. Edit -soname. s/ / /, as multiple
spaces are magic and unpaddable in troff.
1998-07-26 02:51:59 +00:00
mycroft
cfaad53a4e Remove bogus change to use -O0. 1998-07-25 12:37:27 +00:00
ross
9535b6c2a3 Harmonize another ELF linker option: ignore export-dynamic in the COFF linker.
Elaborate on some of the ELF option descriptions, and don't say the options
are ignored...this man page is the one installed on ELF systems, too.
1998-07-25 11:58:49 +00:00
tv
77a275d732 Change ld.so default behavior to RTLD_LOCAL, and make RTLD_LOCAL into a
new flag bit.  Keep RTLD_GLOBAL as an actual flag bit so it won't be
re-used, or may be used for something later.  Mask the dlopen() mode bits
in ld.elf_so so a comparison against RTLD_NOW works.  (RTLD_{LOCAL,GLOBAL}
needs to be implemented for ld.elf_so.)
1998-07-14 22:18:36 +00:00
kleink
76bc8071eb Clear the error indicator after retrieval (xref. dlerror(3)). 1998-05-30 18:28:31 +00:00
tv
b05a04267a In case NOPICINSTALL is set, get -lc_pic from src/lib/libc/(objdirname). 1998-05-21 00:31:05 +00:00
pk
294ed94908 Optimize symbol/string table access slightly by precomputing their
locations at load time. These values don't change once the object is loaded.
1998-05-19 12:15:38 +00:00
thorpej
dd26162d11 Need <dlfcn.h> for Dl_info. 1998-05-14 01:55:28 +00:00
pk
d123bc84d4 Implement `dladdr()': find nearest symbol given an address. 1998-05-12 21:22:28 +00:00
pk
79bd77e1cc Add `dladdr()' rtld entry point. 1998-05-12 21:21:21 +00:00
fair
c46ab392dc Principally, change foo(N) to .Xr foo N
Also, do some other mdoc tagging.
1998-04-28 04:07:04 +00:00
fvdl
98712f00f0 If a good matching shared library is found, don't look in the next
directories. This is compatible with the SunOS behaviour. Also,
it fixes a problem where it was not possible for some 3rd party
package to have a library with the same name as a library already
in the system, and a lower version number. The highest version
would always be picked. This particular problem shows up with Mozilla,
which has a libutil.so.1.0
1998-04-04 01:00:29 +00:00
mycroft
ab8a4c5234 Allow a non-RTLD_GLOBAL object to refer to symbols in itself. 1998-03-26 23:33:12 +00:00
pk
d47d43b956 Use file size from fstat(2) to map the hints file, instead of fiddling
with incremental mmap()'s.  Squashes a bug which caused only the first
page of the hints file to unmapped.
1998-03-18 23:21:46 +00:00
pk
5ea8bb6d05 Implement RTLD_GLOBAL dlopen(3) flag.
Rename internal flags to avoid <dlfcn.h> name space collisions.
1998-03-15 23:10:21 +00:00
pk
b5f4c3ad5e Check for short hints file (noticed by Chuck Silvers). 1998-03-15 21:24:27 +00:00
mycroft
28ad88290d Remove spurious extra newline. 1998-03-03 00:36:24 +00:00
cgd
8aaf609a0a allow LDSTATIC definition to be overridden by bsd.own.mk/mk.conf 1998-03-02 19:42:25 +00:00
mycroft
4462053ab3 Fill in missing (default) mmap(2) flags. 1998-02-20 09:27:18 +00:00
jonathan
730100e9cd Add emulation of binutils 2.x ld options:
-rpath dir, -shared, -soname, --whole-archive, --no-whole-archive
for compatibility with ELF ports and to aid migration to bintils.
Update manpage with new otions.
1998-02-20 03:12:50 +00:00
pk
9084f293a7 Print a warning message if we detect that a "copy symbol" has changed
size in a shared library.  Also, always use our expected size to copy
the item in, on the assumption that doing so generally minimizes the
damage (maybe it's better to just bail out?).
1998-02-17 23:07:33 +00:00
cgd
10cc9f3b70 RCS Id police 1998-01-05 22:00:34 +00:00
cgd
cb1cb72951 bsd.prog.mk isn't needed here, and including it only gets us an
unnecessary obj dir.
1998-01-05 21:56:31 +00:00
pk
f58457ccca Expand on shared object's `.init' functions a bit, and mention
`/usr/lib/c++rt.o'.
1997-11-13 22:25:23 +00:00
lukem
da49bfcda7 use CPPFLAGS instead of CFLAGS 1997-10-25 10:10:19 +00:00
mark
919c9148f3 Add support for PIC code.
Add support for ld.so
1997-10-17 21:25:42 +00:00
christos
776130f509 Handle relocation of misaligned symbols. Handle all three cases by the same
macro for clarity.
1997-10-14 17:17:52 +00:00
mycroft
e96e918e60 Use bsd.subdir.mk as appropriate. 1997-10-11 09:34:07 +00:00
thorpej
c46d775b91 Document new flags and internal processing of ld.so.conf changes. 1997-08-27 06:43:07 +00:00
thorpej
c48a53ac99 Enhancements from Jim Bernard <jbernard@tater.mines.edu>, to support
processing of /etc/ld.so.conf in ld.so itself (rather than in /etc/rc):
- added do_conf function and call to it in main to implement internal
  processing of /etc/ld.so.conf
- moved maintenance of dir_list to dodir, with an added argument to
  dodir to specify whether dir_list should be updated
- added option '-c' to suppress processing of /etc/ld.so.conf
- added option '-S' to suppress processing of std directories (but not
  /etc/ld.so.conf)
- modified option -s to suppress processing of _both_ std directories
  and /etc/ld.so.conf (i.e., it is equivalent to -cS)--this was done
  so that users and scripts that interpret -s as meaning "process
  only directories specified on the command line" would not be
  startled

From PR #4031.  One change was not committed, since it was unnecessary
(option variables are in the BSS, and do not need to be initialized to
0 explicitly).

Plus one change from me:
- getopt() returns -1 when completed, not EOF.
1997-08-26 19:29:57 +00:00
mikel
2bb07f9f5c xref ldconfig(8) not nonexistent ldconfig(1) 1997-07-16 04:34:36 +00:00
christos
df79fb912d Add the necessary -I flag to pick up the libc/include/extern.h 1997-07-14 02:56:54 +00:00
matthias
a57d8745e7 * Truncate the cinv table. It was twice as long as necessary as a result
of an earlier version of th code.
* Really align the cinv table modulo 0x200. Thank's to Ian for telling me
  where I goofed up.
1997-07-11 23:39:56 +00:00
matthias
df05f3a8b1 * Flush the icache from user mode. The original code and the idea came from
Ian Dall. I just did some slight optimizations.
1997-07-09 19:32:51 +00:00
pk
c7531c0573 State explicitly that an internal consistency check failed (PR#2660). 1997-07-04 22:15:41 +00:00
pk
72023de51f Do not free dlopen'ed map structures twice.
Plug memory leak when opening the same object mor than once.
1997-06-30 22:10:06 +00:00
pk
7a27a9dd43 Fix typo in free_link_map(); noticed by Mike Grupenhoff. 1997-06-30 20:49:40 +00:00
pk
c682966345 Patch from Chris Demetriou to unmap an object on last dlclose(), which
had not be implemented. It would cause an "adress space leak" and, if
the same object would opened multiple time, unwanted relocations.
Re: Comment from Chris:

"The a.out ld.so has some problems with dlclose.  It doesn't properly
unmap objects which are dlclosed.  That's a known problem (though a
serious one for programs which dlopen then dlclose lots of objects,
because it causes address space exhaustion), but it has a
previously-unknown side-effect.

If a single object is dlopened, then dlclosed, then dlopened _again_,
the relocations will be processed again.  That causes obvious
problems."
1997-06-26 20:52:06 +00:00
mrg
586ed80911 install all man pages. 1997-06-23 13:25:41 +00:00
pk
4dd59ab4df Fix typos (PR#3761). 1997-06-20 20:38:08 +00:00
mikel
0bf17c4d39 fix typo; from Saitoh Masanobu in PR misc/3696.
also comma-separate and reorder xrefs.
1997-06-03 04:24:25 +00:00
cjs
7a66732d34 Back out BUILDDIR and NOINSTALL changes. 1997-05-31 21:21:13 +00:00
cjs
097e643f79 Remove an ifdef. Add comment about -nostdlib vs. ELF ld. 1997-05-30 14:06:34 +00:00
veego
d0b955050b Use the extra LDFLAGS if OBJDIR is defined. 1997-05-30 11:39:01 +00:00
cjs
c21a83a6fb PR 3670 from SAITOH Masanobu <msaitoh@spa.is.uec.ac.jp>
Fix typos.
1997-05-26 00:40:39 +00:00
pk
ff90cf758b Keep track of `dlsym()' symbol lookup scope differently. There's (currently)
only one special case: a NULL argument to dlopen(); return a special
token for that case.
1997-05-03 08:00:02 +00:00
christos
ffc1ff32d7 Add BINDIR 1997-04-19 17:09:53 +00:00
christos
108e13f159 Moved to arch 1997-04-16 16:59:44 +00:00
christos
2869186c80 moved to arch 1997-04-16 16:59:03 +00:00
christos
ac37de3d7e Moved to arch 1997-04-16 16:57:13 +00:00
christos
bdb0a5aeae moved to arch 1997-04-16 16:56:07 +00:00
christos
76a60a39c3 Moved to arch 1997-04-16 16:55:18 +00:00
christos
d3d1227320 Ld directory reorganization:
- separate out the common files used by rtld ldd ld
	- move machine dependent files into arch
	- move ld in its own directory
	- factor out .PATH and CFLAGS common to all Makefiles
1997-04-16 16:49:28 +00:00
christos
b4f53dbf7c mktemp() -> mkstemp() 1997-04-16 16:46:28 +00:00
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