• Vasily Gorbik's avatar
    s390: avoid vmlinux segments overlap · 5a2e1853
    Vasily Gorbik authored
    Currently .vmlinux.info section of uncompressed vmlinux elf image is
    included into the data segment and load address specified as 0. That
    extends data segment to address 0 and makes "text" and "data" segments
    overlap.
    Program Headers:
      Type           Offset             VirtAddr           PhysAddr
                     FileSiz            MemSiz              Flags  Align
      LOAD           0x0000000000001000 0x0000000000100000 0x0000000000100000
                     0x0000000000ead03c 0x0000000000ead03c  R E    0x1000
      LOAD           0x0000000000eaf000 0x0000000000000000 0x0000000000000000
                     0x0000000001a13400 0x000000000233b520  RWE    0x1000
      NOTE           0x0000000000eae000 0x0000000000fad000 0x0000000000fad000
                     0x000000000000003c 0x000000000000003c         0x4
    
     Section to Segment mapping:
      Segment Sections...
       00     .text .notes
       01     .rodata __ksymtab __ksymtab_gpl __ksymtab_strings __param
       __modver .data..ro_after_init __ex_table .data __bug_table .init.text
       .exit.text .exit.data .altinstructions .altinstr_replacement
       .nospec_call_table .nospec_return_table .boot.data .init.data
       .data..percpu .bss .vmlinux.info
       02     .notes
    
    Later when vmlinux.bin is produced from vmlinux, .vmlinux.info section
    is removed. But elf vmlinux file, even though it is not bootable anymore,
    used for debugging and loadable segments overlap should be avoided.
    
    Utilize special ":NONE" phdr specification to avoid adding .vmlinux.info
    into loadable data segment. Also set .vmlinux.info section type to INFO,
    which allows to get a not-loadable info CONTENTS section.
    
    Since minimal supported version of binutils 2.20 does not have
    --dump-section objcopy option, make .vmlinux.info section loadable during
    info.bin creation to get actual section contents.
    Reported-by: default avatarPhilipp Rudo <prudo@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
    5a2e1853
vmlinux.lds.S 3.65 KB