This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix lazy setting for PLTREL overlap cpus.


On Tue, Apr 3, 2012 at 11:45 PM, David Miller <davem@davemloft.net> wrote:
> From: "Carlos O'Donell" <carlos@systemhalted.org>
> Date: Tue, 3 Apr 2012 23:39:34 -0400
>
>> We need some ASCII art here:
>>
>> Overlap case:
>> (a) Start with:
>> |<---DT_REL(A)------------------------------>|
>> ? ? ? ? ? ? ? |<---DT_JMPREL--->|
>> (b) Compute
>> |<---- r0 --->|<----- r1 ------>|<--- r2 --->|
>>
>> vs.
>>
>> Non-overlap case:
>> |<---DT_REL ---->|<---DT_JMPREL--->|
>> |<--- r0 ------->|<--- r1 -------->|
>
> I've also been thinking about the fact that I've never seen DT_JMPREL
> in the middle of DT_REL(A), it always just consumes strictly the end
> of DT_REL(A) when it overlaps.
>
> Eliminating the handling of that case would simplify things
> considerably, because then you only need two ranges whether there can
> be overlap or not.

As I see it you have two options:

(a) Split the relocs into regions of lazy and non-lazy processing,
calling elf_dynamic_do_rel(a) with lazy set correctly for the region.

(b) Complicate elf_dynamic_do_rel(a) by passing down information about
the DT_JMPREL relocations so it knows where they are and avoid
processing them if lazy.

Truthfully I don't like (b) since it just moves the mess elsewhere.

A refactoring of the macro would be a win though.

If on sparc32/sparc64 you have *never* had overlap then stop defining
ELF_MACHINE_PLTREL_OVERLAP at all and that's one less target to worry
about and one more step closer to the eventual removal of this code.

The better and more flaming question is aimed at Chris Metcalf from TILERA.

Chris, Why do you define ELF_MACHINE_PLTREL_OVERLAP? Did you mean to?
Does your binutils *actually* produce a DT_RELA that overlaps with
DT_JMPREL? Why did you do that?

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]