After [r1295] which added the --change-section-lma option the phdr p_paddr and p_vaddr are both set to the same address.
This breaks the FreeBSD Xen build as described in the thread at https://lists.freebsd.org/pipermail/freebsd-virtualization/2016-March/004243.html
With GNU objcopy:
Elf file type is EXEC (Executable file)
Entry point 0xffffffff802fb000
There are 6 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flg Align
PHDR 0x0000000000000040 0xffffffff80200040 0x0000000000200040
0x0000000000000150 0x0000000000000150 R E 0x8
INTERP 0x0000000000000190 0xffffffff80200190 0x0000000000200190
0x000000000000000d 0x000000000000000d R 0x1
[Requesting program interpreter: /red/herring]
LOAD 0x0000000000000000 0xffffffff80200000 0x0000000000200000
0x000000000147b978 0x000000000147b978 R E 0x200000
LOAD 0x000000000147b978 0xffffffff8187b978 0x000000000187b978
0x0000000000134e40 0x000000000056e448 RW 0x200000
DYNAMIC 0x000000000147b978 0xffffffff8187b978 0x000000000187b978
0x00000000000000d0 0x00000000000000d0 RW 0x8
GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 RWE 0x8
With elfcopy:
Elf file type is EXEC (Executable file)
Entry point 0xffffffff802fb000
There are 6 program headers, starting at offset 64
Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flg Align
PHDR 0x0000000000000040 0xffffffff80200040 0xffffffff80200040
0x0000000000000150 0x0000000000000150 R E 0x8
INTERP 0x0000000000000190 0xffffffff80200190 0xffffffff80200190
0x000000000000000d 0x000000000000000d R 0x1
[Requesting program interpreter: /red/herring]
LOAD 0x0000000000000000 0xffffffff80200000 0xffffffff80200000
0x000000000147a418 0x000000000147a418 R E 0x200000
LOAD 0x000000000147a418 0xffffffff8187a418 0xffffffff8187a418
0x0000000000134aa0 0x000000000056e0a8 RW 0x200000
DYNAMIC 0x000000000147a418 0xffffffff8187a418 0xffffffff8187a418
0x00000000000000d0 0x00000000000000d0 RW 0x8
GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000 RWE 0x8
I'll handle it.
Might be fixed as of [r3436]. Need verify. Thanks!
Related
Commit: [r3436]
royger@freebsd tested and reports
Kai do you have anything else you want to do here?
Fixed.