Bug 16533 - Gold does not set HASENTRY attribute on ARM
Summary: Gold does not set HASENTRY attribute on ARM
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.25
: P2 normal
Target Milestone: ---
Assignee: Doug Kwan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 11:46 UTC by Yury Gribov
Modified: 2014-02-13 10:51 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Proposed patch (461 bytes, patch)
2014-02-06 11:46 UTC, Yury Gribov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Gribov 2014-02-06 11:46:28 UTC
Created attachment 7396 [details]
Proposed patch

I've recently detected an inconsistency between ld.bfd and ld.gold on ARM platforms. It seems that Gold does not set entry flag in ELF header:

# Binutils with --enable-gold=no
$ arm-v7a15v5r0-linux-gnueabi-gcc justmain.c
$ arm-v7a15v5r0-linux-gnueabi-readelf -h a.out
ELF Header:
  ...
  Flags:                             0x5000202, has entry point, Version5 EABI, <unknown>

# Binutils with --enable-gold=default
$ arm-v7a15v5r0-linux-gnueabi-gcc justmain.c
$ arm-v7a15v5r0-linux-gnueabi-readelf -h a.out
ELF Header:
  ...
  Flags:                             0x5000000, Version5 EABI

The attached simple patch seems to fix this:
$ arm-v7a15v5r0-linux-gnueabi-readelf -h a.out
ELF Header:
  ...
  Flags:                             0x5000002, has entry point, Version5 EABI
Comment 1 Yury Gribov 2014-02-13 10:51:44 UTC
Closing as invalid after discussion on mailing list: https://sourceware.org/ml/binutils/2014-02/msg00076.html