Project

General

Profile

Actions

Bug #2005

closed

Add 7 more auxinfo types to support RTLD upgrade]

Added by dragonflybsd1 about 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Hi Matt,
I'd like to make another pitch for implementing AT_EXECPATH only, and
leave the other six auxinfo candidates as unimplemented as previously
discussed.

The one-sentence summary is that the fallback mechanism doesn't provide
the same path information as the auxinfo AT_EXECPATH version, and it
affects the functionality of the new libmap.conf and the dynamic rpath
token expansion functionality of the rtld upgrade.

I have improved the fallback mechanism as shown in the attachments
(freebsd version, improved fallback version). This seems to allow the
new DragonFly RTLD to function as expected with libmap.conf and $ORIGIN
token, but it requires the use of getcwd, access, and realpath in order
to do it. As an example, with AT_EXECPATH implemented, the command "ldd
somefile" to get expanded "/usr/bin/ldd /true/path/to/somefile".
Without AT_EXECPATH implemented it remains as "ldd somefile". With my
improved fallback, the command gets expanded to "ldd
/true/path/to/somefile".

If vn_fullpath has better performance than 3 combined functions, then
implementing AT_EXECPATH may be worth it for performance reasons.

What do you think?

Regards,
John

Matthew Dillon wrote:

Ok, I'm going to let Sascha handle this submission too. I
talked with John a bit about it and here is my position:

  • For the sake of making the porting easier I'm O.K. with
    the userland side being implemented, with the exception
    of the PAGESIZES stuff.
  • I am very much <against> implementing any of the kernel side.
    I don't see any point whatsoever in these 'features' other than
    adding unnecessary complexity to the system just to replace
    a few system calls that already only take ~200ns to run or less.
  • Plus we also have our 'resident' utility. I guess people might
    have forgotten that we have that. It removes nearly all of the
    overhead of loading a complex dynamically linked program. We
    don't need these added features in DFly to make things go faster.

So, in summary, The #define's are ok, but the kernel shouldn't
implement any of them (no kernel code or in-kernel structural
changes). The userland code support is ok, with the exception of
the PAGESIZES sysctl stuff because I don't think we should implement
any kernel side support for that, at least not the way they've got
it setup.

-Matt


Files

rtld.excerpt.improved.c (1.08 KB) rtld.excerpt.improved.c dragonflybsd1, 02/28/2011 09:00 PM
rtld.excerpt.original.c (613 Bytes) rtld.excerpt.original.c dragonflybsd1, 02/28/2011 09:00 PM
Actions #1

Updated by dillon about 13 years ago

:Hi Matt,
:I'd like to make another pitch for implementing AT_EXECPATH only, and
:leave the other six auxinfo candidates as unimplemented as previously
:discussed.
:
:The one-sentence summary is that the fallback mechanism doesn't provide
:the same path information as the auxinfo AT_EXECPATH version, and it
:affects the functionality of the new libmap.conf and the dynamic rpath
:token expansion functionality of the rtld upgrade.
:
:I have improved the fallback mechanism as shown in the attachments
:(freebsd version, improved fallback version). This seems to allow the
:new DragonFly RTLD to function as expected with libmap.conf and $ORIGIN
:token, but it requires the use of getcwd, access, and realpath in order
:to do it. As an example, with AT_EXECPATH implemented, the command "ldd
:somefile" to get expanded "/usr/bin/ldd /true/path/to/somefile".
:Without AT_EXECPATH implemented it remains as "ldd somefile". With my
:improved fallback, the command gets expanded to "ldd
:/true/path/to/somefile".
:
:If vn_fullpath has better performance than 3 combined functions, then
:implementing AT_EXECPATH may be worth it for performance reasons.
:
:What do you think?
:
:Regards,
:John

All right, go ahead.  I can see where AT_EXECPATH would solve the
considerable confusion which reigns due to the target library not
being handed the exec path from the loader.
-Matt
Actions #2

Updated by marino almost 13 years ago

Implemented in 2.11

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/
adc42cf35b64fcc5e902e062955772f363e1ec58

The elf headers that define AT_EXECPATH were updated in the previous commit.

Actions

Also available in: Atom PDF