[PATCH] allow easier overriding of ELF_DYNAMIC_INTERPRETER

Hans-Peter Nilsson hp@bitrange.com
Sun Feb 17 02:35:00 GMT 2002


On Sun, 17 Feb 2002, David O'Brien wrote:
> On Sun, Feb 17, 2002 at 04:05:48AM -0500, Hans-Peter Nilsson wrote:
> > Why treat overrides of ELF_DYNAMIC_INTERPRETER specially?
>
> The problem is the specified ELF_DYNAMIC_INTERPRETER is not correct for
> 90% of the Binutils installations.

Well, it's right for cris-axis-linux-gnu, so that's a bad
example.

> It is an implementation detail that never should have been specified
> psABI's.  So I desire an easy way to set the correct
> ELF_DYNAMIC_INTERPRETER for the target.  Yes I know that GCC uses the
> "-dynamic-linker" argument to `ld'.  And that one can manually specify it
> when invoking `ld' directly.  However it is just wrong that `ld' on the
> open source Unixes has the wrong ELF_DYNAMIC_INTERPRETER path.

Why not correct it rather than override it?  Where you need to
override (where it is correct "sometimes"), what do you want to
do with the override?  If anything, it should go into a separate
bfd vector.  So you'd need a separate .c file anyway.

> > And when you actually do need to override stuff, what's
> > wrong with the #ifndef approach: having a new file, defining
> > stuff and including the original file, like is used in
> > elf32-sh-lin.c?
>
> Please explain how to use this approach.

Not much to explain that shouldn't be obvious from a quick look
at elf32-sh-lin.c.  In old file, add "#ifndef the_item" wrappers
for the defined item and likewise for the vector name.  In the
new file, "#define the_item new_value" together with a new
vector name and "#include the_original_file".

> > Why add some new mechanism for generalization needlessly and for what
> > seems a thought-up reason,
>
> The need is real for open source OS's; and OS's that are not the vendor
> of the hardware platform.

Again, why not correct it where it's known to be wrong?

I can't think of a reason where you'd have different
ELF_DYNAMIC_INTERPRETER values for one and the same bfd vector.

brgds, H-P



More information about the Binutils mailing list