
To help tools like addr2line looking up function names, in particular when dealing with e.g. PE/COFF binaries (linked from ELF objects), where there's no ELF symbol table to fall back to, emit minimalistic information for functions marked as such and having their size specified. Notes regarding the restriction to (pure) ELF: - I realize this is a layering violation; I don't see how to deal with that in a better way. - S_GET_SIZE(), when OBJ_MAYBE_ELF is defined, looks wrong: Unlike S_SET_SIZE() it does not check whether the hook is NULL. - symbol_get_obj(), when OBJ_MAYBE_ELF is defined, looks unusable, as its return type can only ever be one object format's type (and this may then not be ELF's). The new testcases are limited to x86 because I wanted to include the case where function size can't be determined yet at the time Dwarf2 info is generated. As .nops gains support by further targets, they could also be added here then (with, as necessary, expecations suitably relaxed to cover for insn size differences).
40 lines
475 B
ArmAsm
40 lines
475 B
ArmAsm
.text
|
|
|
|
.ifndef LOCAL
|
|
efunc1:
|
|
.nop
|
|
.nop
|
|
.global efunc1
|
|
.type efunc1, %function
|
|
.size efunc1, .-efunc1
|
|
.endif
|
|
|
|
.ifndef GLOBAL
|
|
lfunc1:
|
|
.nops 16
|
|
.nop
|
|
.type lfunc1, %function
|
|
.size lfunc1, .-lfunc1
|
|
.endif
|
|
|
|
.ifndef LOCAL
|
|
efunc2:
|
|
.nop
|
|
.nops 32
|
|
.nop
|
|
.global efunc2
|
|
.type efunc2, %function
|
|
.size efunc2, .-efunc2
|
|
.endif
|
|
|
|
.global efunc3
|
|
.type efunc3, %function
|
|
|
|
.ifndef GLOBAL
|
|
lfunc2:
|
|
.nop
|
|
.nop
|
|
.nop
|
|
.type lfunc2, %function
|
|
.size lfunc2, .-lfunc2
|
|
.endif
|