brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · f54cf3b Raw
52 lines · plain
1# RUN: yaml2obj -D PADDR1=0x1000 -D PADDR2=0x1004 %s -o %t12# RUN: llvm-objcopy -O binary %t1 %t1.out3# RUN: od -t x2 -v %t1.out | FileCheck %s --ignore-case4 5## When all p_paddr fields are 0, GNU objcopy resets LMA to VMA6## and gives a different output.7## https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=6ffd79000b45e77b3625143932ffbf781b6aecab8## We don't implement this special rule. For the p_paddr=0 case: .text and9## .data are rewritten to the same place. The size is 4. # the p_paddr=1 case.10# RUN: yaml2obj %s -o %t011# RUN: llvm-objcopy -O binary %t0 %t0.out12# RUN: od -t x2 -v %t0.out | FileCheck %s --check-prefix=CHECK0 --ignore-case13 14!ELF15FileHeader:16  Class:           ELFCLASS6417  Data:            ELFDATA2LSB18  Type:            ET_EXEC19  Machine:         EM_X86_6420Sections:21  - Name:            .text22    Type:            SHT_PROGBITS23    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]24    Address:         0x100025    AddressAlign:    0x000000000000100026    Content:         "c3c3c3c3"27  - Name:            .data28    Type:            SHT_PROGBITS29    Flags:           [ SHF_ALLOC ]30    Address:         0x100431    AddressAlign:    0x000000000000000432    Content:         "3232"33ProgramHeaders:34  - Type:     PT_LOAD35    Flags:    [ PF_X, PF_R ]36    VAddr:    0x100037    PAddr:    [[PADDR1=0]]38    FirstSec: .text39    LastSec:  .text40  - Type:     PT_LOAD41    Flags:    [ PF_R, PF_W ]42    VAddr:    0x100443    PAddr:    [[PADDR2=0]]44    FirstSec: .data45    LastSec:  .data46 47# CHECK:       0000000 c3c3 c3c3 323248# CHECK-NEXT:  000000649 50# CHECK0:      0000000 3232 c3c351# CHECK0-NEXT: 000000452