Stratego/XT JIRA  History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: NIXPKGS-85
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Eelco Dolstra
Reporter: Eelco Dolstra
Votes: 0
Watchers: 0
Operations

Clone this issue
Comment on this issue
Create sub-task
If you were logged in you would be able to see more operations.
Nix Packages

patchelf + strip breaks ghcboot

Created: 2008-02-22 12:24   Updated: 2008-05-27 14:01
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
The combination of patchelf and strip -S sometimes produces executables that don't work:

$ strace -fF /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/lib/ghc-6.4.2/ghc-6.4.2
execve("/nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/lib/ghc-6.4.2/ghc-6.4.2", ["/nix/store/ka8gghwlgbqxm2b387fbp"...], [/* 32 vars */]) = -1 EINVAL (Invalid argument)
+++ killed by SIGKILL +++

Strip also prints out a lot of errors:
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .dynamic lma 0x8047134 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .dynstr lma 0x8047214 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .dynsym lma 0x8047570 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .hash lma 0x8047a40 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .interp lma 0x8047c88 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section .note.ABI-tag lma 0x8047cd0 overlaps previous sections
BFD: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/bin/stGgo2oC: section `.note.ABI-tag' can't be allocated in segment 7

And when ld-linux is used directly, it says:

$ /nix/store/m2582n03z3jkq2rba5ll9fkh6zl69ylr-glibc-2.7/lib/ld-linux.so.2 /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/lib/ghc-6.4.2/ghc-6.4.2
/nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/lib/ghc-6.4.2/ghc-6.4.2: error while loading shared libraries: /nix/store/ka8gghwlgbqxm2b387fbpgp4agylm1ss-ghc-6.4.2/lib/ghc-6.4.2/ghc-6.4.2: ELF load command address/offset not properly aligned

Worked around by passing dontStrip = true to the ghcboot builder.

 All   Comments   Work Log   Change History      Sort Order:
Eelco Dolstra [2008-03-04 10:04]
This also affects the NVIDIA driver.

Eelco Dolstra [2008-05-27 14:01]
This seems to be a bug in strip (binutils).

It rearranges some sections, then changes the program headers in a bad way. For instance, the phdr

LOAD 0x001000 0x08048000 0x08048000 0x9eab0 0x9eab0 R E 0x1000

is changed to

LOAD 0x000844 0x08048000 0x08048000 0x9eab0 0x9eab0 R E 0x1000

In other words the start offset is screwed up somewhere.