aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1998-09-05 20:28:48 +0000
committerJohn Polstra <jdp@FreeBSD.org>1998-09-05 20:28:48 +0000
commita3bd40194294b482ac524997ce0661830d0dd5ed (patch)
tree86692531210b0772566e538116f5c0708ceb3a25 /libexec
parente99ea9ec2be47cffc3395d3ee541a26d92ea8ae1 (diff)
downloadsrc-a3bd40194294b482ac524997ce0661830d0dd5ed.tar.gz
src-a3bd40194294b482ac524997ce0661830d0dd5ed.zip
Don't recognize a file as an a.out shared library unless it has at
least 2 version numbers. This fixes the bug where the dynamic linker would try to load an ELF shared library if it found one. Note, this change also fixes the same thing in "ld", because the code is shared. For "ld" there is still a problem with ".a" libraries, which cannot be distinguished by name. I haven't decided what, if anything, to do about that.
Notes
Notes: svn path=/head/; revision=38870
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-aout/shlib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libexec/rtld-aout/shlib.c b/libexec/rtld-aout/shlib.c
index 34d88e9ff4de..5bd968f66cba 100644
--- a/libexec/rtld-aout/shlib.c
+++ b/libexec/rtld-aout/shlib.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: shlib.c,v 1.19 1998/05/26 20:12:49 sos Exp $
+ * $Id: shlib.c,v 1.20 1998/06/07 03:53:08 brian Exp $
*/
#include <sys/param.h>
@@ -301,15 +301,14 @@ search_lib_dir(dir, name, majorp, minorp, do_dot_a)
int cur_ndewey;
cur_ndewey = getdewey(cur_dewey, extension+3);
- if(cur_ndewey == 0) /* No version number */
+ if(cur_ndewey < 2) /* Too few version numbers */
continue;
if(*majorp != -1) { /* Need exact match on major */
if(cur_dewey[0] != *majorp)
continue;
if(*minorp != -1) { /* Need minor >= minimum */
- if(cur_ndewey < 2 ||
- cur_dewey[1] < *minorp)
+ if(cur_dewey[1] < *minorp)
continue;
}
}
@@ -330,8 +329,7 @@ search_lib_dir(dir, name, majorp, minorp, do_dot_a)
if(dot_so_name[0] != '\0') {
*majorp = best_dewey[0];
- if(best_ndewey >= 2)
- *minorp = best_dewey[1];
+ *minorp = best_dewey[1];
return concat(dir, "/", dot_so_name);
}