https://bugs.llvm.org/show_bug.cgi?id=50160

            Bug ID: 50160
           Summary: --only-keep-debug crash with no section header table
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-objcopy/strip
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected],
                    [email protected],
                    [email protected],
                    [email protected], [email protected]

Found this on an internal binary. llvm-objcopy --only-keep-debug crashes here,
although the input file is weird -- we should probably have a similar error
message as GNU objcopy.

$ cat /tmp/x.yaml 
--- !ELF
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_EXEC
Sections:
  - Name:    .foo
    Type:    SHT_PROGBITS
    Flags:   [ SHF_ALLOC ]
    Size:    0x01000
ProgramHeaders:
  - Type:            PT_NULL
    Flags:           [  ]
    FileSize:        0x01000
$ bin/yaml2obj /tmp/x.yaml > /tmp/x.o
$ bin/llvm-strip --strip-sections /tmp/x.o
$ bin/llvm-objcopy --only-keep-debug /tmp/x.o /tmp/y.o
<crash>
$ objcopy /tmp/x.o /tmp/y.o  # Note: GNU objcopy
objcopy: error: the input file '/tmp/x.o' has no sections

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to