Bug 1275709 - ppc64 ld cannot link ppc64le objects
ppc64 ld cannot link ppc64le objects
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
22
ppc64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Nick Clifton
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-27 10:30 EDT by Laurent Vivier
Modified: 2016-07-19 16:15 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-07-19 16:15:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Add ppc64le target for ld in .specs (353 bytes, patch)
2015-10-27 10:30 EDT, Laurent Vivier
no flags Details | Diff

  None (edit)
Description Laurent Vivier 2015-10-27 10:30:13 EDT
Created attachment 1086859 [details]
Add ppc64le target for ld in .specs

Description of problem:

ld cannot manages ppc64le objects.

$ ld -V
GNU ld version 2.25-9.fc22
  Supported emulations:
   elf64ppc
   elf32ppc
   elf32ppclinux
   elf32ppcsim
   elf32_spu

As 'as', 'gdb' and 'gcc' are able to manage little-endian code, ld is the only missing part to build/debug a ppc64le kernel on a ppc64 host.

Version-Release number of selected component (if applicable):

$ ld -v
GNU ld version 2.25-9.fc22

How reproducible:

100%

Steps to Reproduce:
1. vi le.c
static const int a = 0x12345678;

void _start(void)
{
}
2. gcc -g -nostdlib -mlittle-endian -m64 -c -o le.o le.c
3. ld -melf64lppc -o le le.o

Actual results:

ld: unrecognised emulation mode: elf64lppc
Supported emulations: elf64ppc elf32ppc elf32ppclinux elf32ppcsim elf32_spu

Expected results:

$ gcc -g -nostdlib -mlittle-endian -m64 -c -o le.o le.c
$ file le.o
le.o: ELF 64-bit LSB relocatable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), not stripped
$ ld -melf64lppc -o le le.o
$ file le
le: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, not stripped
$ gdb le
GNU gdb (GDB) Fedora 7.9.1-19.fc22
...
(gdb) x/4xb &a
0x10000110 <a>:	0x78	0x56	0x34	0x12

On big endian we have here:

(gdb) x/4xb &a
0x10000110 <a>:	0x12	0x34	0x56	0x78

Additional info:
Comment 1 Nick Clifton 2015-10-28 08:37:08 EDT
Hi Laurent,

  Thanks for the bug report and patch.  I have now applied the patch to the rawhide binutils, so if you try out  binutils-2.25.1-8.fc24  you should find that it works.

Cheers
  Nick
Comment 2 Fedora End Of Life 2016-07-19 16:15:10 EDT
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.