Bug 1547747 - gold produces broken executables
Summary: gold produces broken executables
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 27
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-21 20:42 UTC by Serge Pavlovsky
Modified: 2018-03-29 07:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-29 07:19:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
"bad" object, caller(main) object and demonstrating shell script (3.17 KB, application/x-gzip)
2018-02-21 20:42 UTC, Serge Pavlovsky
no flags Details

Description Serge Pavlovsky 2018-02-21 20:42:20 UTC
Created attachment 1399000 [details]
"bad" object, caller(main) object and demonstrating shell script

Description of problem:
same code linked by ld.bfd works fine,linked by ld.gold jumps into the middle of instruction

Version-Release number of selected component (if applicable):
binutils-2.29-6.fc27.x86_64

How reproducible:
$ LANG=C ./run.sh 
+ link bfd
+ gcc codectest.c.o pscopyca.o -o codectest.bfd -fuse-ld=bfd
+ ./codectest.bfd
+ link gold
+ gcc codectest.c.o pscopyca.o -o codectest.gold -fuse-ld=gold
+ ./codectest.gold
./run.sh: line 3: 17605 Segmentation fault      (core dumped) ./codectest.$1


Steps to Reproduce:
1. link attached objects with ld.gold
2. run executable

Actual results:
sigsegv

Expected results:
clean exit

Additional info:
link with ld.bfd to see correct behavior

Comment 1 Nick Clifton 2018-02-23 12:24:16 UTC
I have submitted this bug report to the FSF binutils project so that the gold
maintainers can take a look at it:

https://sourceware.org/bugzilla/show_bug.cgi?id=22883

Comment 2 Nick Clifton 2018-03-23 12:28:11 UTC
Hi Serge,

  The conclusion from the binutils maintainers appears to be that the
  pscopyca.o file is corrupt.  (Specifically it is using a RELA relocation
  but storing it like a REL relocation).

  Please can you tell us how it was created ?

Cheers
  Nick

Comment 3 Serge Pavlovsky 2018-03-29 00:31:17 UTC
it is part of old binary only intel media codecs library

Comment 4 Nick Clifton 2018-03-29 07:19:53 UTC
Hi Serge,

  In which case all I can say is that that binary is broken.  The
  relocations in it are incorrect and cannot and will not be
  processed correctly by todays linkers.  Sorry.

Cheers
  Nick


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