ld-elf/ehdr_start: Pass --build-id to ld

ld-elf/ehdr_start fails with -z separate-code.  Since there is no data
LOAD segment before code LOAD segment:

There are 2 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
  LOAD           0x200000 0x0000000000600000 0x0000000000600000 0x000010 0x000010 R E 0x200000
  LOAD           0x400000 0x0000000000800000 0x0000000000800000 0x000008 0x000008 R   0x200000

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01     .rodata

the program header isn't included in any LOAD segment.  As the result,
reference to __ehdr_start is resolved to zero.  Pass --build-id to ld
to add a data LOAD segment before code LOAD segment to put the program
header in the  data LOAD segment.

	PR ld/22845
	* testsuite/ld-elf/ehdr_start.d: Pass --build-id to ld.
This commit is contained in:
H.J. Lu 2018-02-17 14:54:16 -08:00
parent 34b00afa03
commit d85502cffa
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845
* testsuite/ld-elf/ehdr_start.d: Pass --build-id to ld.
2018-02-17 H.J. Lu <hongjiu.lu@intel.com>
PR ld/22845

View File

@ -1,5 +1,5 @@
#source: ehdr_start.s
#ld: -e _start
#ld: -e _start --build-id
#nm: -n
#target: *-*-linux* *-*-gnu* *-*-nacl*
#xfail: frv-*-*