Bug 1275709 - ppc64 ld cannot link ppc64le objects
Summary: ppc64 ld cannot link ppc64le objects
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 22
Hardware: ppc64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-27 14:30 UTC by Laurent Vivier
Modified: 2016-07-19 20:15 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 20:15:10 UTC
Type: Bug
Embargoed:


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

Description Laurent Vivier 2015-10-27 14:30:13 UTC
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 12:37:08 UTC
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 20:15:10 UTC
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.