Closed Bug 894267 Opened 11 years ago Closed 4 years ago

Elf-hack breaks prelink

Categories

(MailNews Core :: Build Config, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: stransky, Unassigned)

References

()

Details

elf-hack utility break prelink - Prelink throws message "Cannot safely convert .rel.dyn' section from REL to RELA".

According to Jakub Jelinek, the problem is in:

  [ 7] .elfhack.text.v0  PROGBITS        04ef3cb0 049cb0 000082 00  AX  0   0 16
  [ 8] .elfhack.data.v0  PROGBITS        04ef3d38 049d38 03a618 08   A  0   0  8

Complain to whomever added those sections in such bogus spot, normal linker scripts or standard ld.bfd or gold behavior won't add anything like that there.

Just let them be added after .rel*.dyn/.rel*.plt sections instead of before those.

see:
https://bugzilla.redhat.com/show_bug.cgi?id=961687#c4
https://bugzilla.redhat.com/show_bug.cgi?id=961687#c5
Summary: Elf-hack break prelink → Elf-hack breaks prelink
Recently we have to disable elf-hack on RHEL6/Firefox17ESR due to this issue.
Copy of https://bugzilla.redhat.com/show_bug.cgi?id=961687#c5 as the bug is non public:

If you want to understand the issue that the code in question is trying to prevent, the problem are relative relocations applied by the linker, that aren't dynamic.  Say consider you have .L1: label somewhere in .elfhack.text.v0 section
and in .text section call .L1.  So, when linker links this in, it stores the difference between .L1 label in .elfhack.text.v0 section and the call insn into the call insn, but this isn't something prelink can see.  What prelink wants to do for .rel -> .rela change is move all the initial sections lower by a page or multiple pages, so that the .rela.dyn or .rela.plt or both sections can be larger.
But if it just moved also the .elfhack.text.v0 section, that would suddenly break, because the distance between the call insn in .text section and .elfhack.text.v0 increased, but there is nothing that would make it clear that there is any such dependency.  Perhaps the mozilla elfhack sections are special, but how can prelink find out that the sections it is seeing are created by mozilla elfhack version this and this, and not something else.

Marking wontfix, this needs to be addressed by the Firefox team. If you get to the point where you can enable elfhack for Firefox and Thunderbird is still broken we can take a look.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.