I didn't understand idea of size_t max_offset in elfc_get_note_type, the values that we should use to get type name of note are object type of file and note section info. I would separate to two functions elftc_get_note_name and elftc_get_note_type_name. elftc_get_note_name we will know if this note name is invalid and we will return NULL and handle in elfdump and readelf, also we will correct special case CORE in function. In readelf we know that we print <invalid> https://sourceforge.net/p/elftoolchain/code/HEAD/tree/trunk/readelf/readelf.c#l3684...
added original author to the new file
Create helper function in libelftc to get name of note type
looks like I've attached an old version of the binary, so I'll reattach the binary note_sections and checked output in OpenIndiana OS, see note_sections_openIndiana.txt
Sure
Update -n option to dump all note sections