Closed Bug 816403 Opened 12 years ago Closed 7 years ago

Investigate using elf-hack on gonk system libraries

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: cjones, Unassigned)

References

Details

I don't have a good feel for what kind of libraries elf-hack works well on.  As I recall, it bails on everything but libxul.so in the gecko tree.  Most of the gonk libs are more like libnspr.so than libxul.so, so it might not make a difference.  But would be an interesting experiment to try.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #0)
> I don't have a good feel for what kind of libraries elf-hack works well on. 

Essentially, anything that has more than 5KB worth of relative relocations.
Note you can also force elfhack to still do something with the -f flag. This won't change the file size, but may speed up relocation for that library.

Note that elfhack breaks prelinking.
How does it break prelinking?  Do you mean that if you build all your libraries, define prelink table X, then run elfhack, then table X is invalid to use for prelinking?  If so, that's perfectly fine and expected.  b2g controls its prelink tables.

If it's something else, I'm all ears :).
Prelink table? I don't know if prelinking works in Android differently from how it works on GNU/Linux, but on GNU/Linux, prelinking essentially pre-applies relocations. Considering elfhack does handle relocations in code it injects...
prelinking also changes virtual addresses in the program headers of the files, and elfhack doesn't support that (iirc), so applying elfhack on a prelinked file would fail.
(In reply to Mike Hommey [:glandium] from comment #5)
> elfhack doesn't support that (iirc)

(but maybe I'm confusing with the custom android linker ; too much different ELF hacking)
Android's prelinking is similar to Linux's but happens on host and is much simpler. It strips relocation info. It fails if the dependencies changes or unable to be loaded for any reasons. If libc.so is going to be updated, almost every other libraries must be updated, too. Is this a problem?

Linux's prelinker runs on target, typically every two weeks, and reserves relocation info to be able to fall back. It doesn't work with bionic and vice versa.

Local prelinking should have no effects on a elfhacked lib since local relocations are already removed.
Closing this old B2G bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.