Skip to content

[llvm-objdump] --disassemble-symbols doesn't account for ELF symbol size #166412

@lenary

Description

@lenary

Elf Symbols often have a specific size. This size (when nonzero) is not taken into account by --disassemble-symbols=<sym>

This makes it hard to disassemble a single function, if that function has e.g. local symbols. This can happen when disassembling a relocatable object. The disassembly will stop at the first local symbol, rather than disassembling the encoded size of the function.

Of course, if the size is zero, we have to treat the size as unknown, and stopping on the next symbol mostly makes sense - though I don't know whether we should take into account the symbol binding, and maybe skip local symbols.

This comment implies this is intended behaviour, but I think it would be better if it wasn't the behaviour

// The end is the section end, the beginning of the next symbol, or
// --stop-address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproving things as opposed to bug fixing, e.g. new or missing featuretools:llvm-objdump

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions