Debug info sections need R_WASM_FUNCTION_OFFSET_I32 relocs (with FK_Data_4 fixup kinds) to refer to functions (instead of R_WASM_TABLE_INDEX as is used in data sections). Usually this is done in a convoluted way, with unnamed temp data symbols which target the start of the function, in which case WasmObjectWriter::recordRelocation converts it to use the section symbol instead. However in some cases the function can actually be undefined; in this case the dwarf generator uses the function symbol (a named undefined function symbol) instead. In that case the section-symbol transform doesn't work and we need to generate the correct reloc type a different way. In this change WebAssemblyWasmObjectWriter::getRelocType takes the fixup section type into account to choose the correct reloc type.
Fixes PR50408
@sbc100 from here, testing with Andy's example I found that we are getting some fixups where SymA has type data (or no type?) but the relocation is clearly intended to be against a function symbol (it has the name of a function and is a R_WASM_FUNCTION_OFFSET reloc). Also the SECTION_OFFSET relocs with target symbols in the .debug_str section are all nameless symbols. I don't really understand yet why either of these are the way they are.