Currently, all relocations that point inside a function are registered
as external references. If these relocations cannot be resolved as jump
tables or computed gotos, the containing function gets marked as
not-simple and excluded from optimizations.
RISC-V uses relocations for branches and jumps (to support linker
relaxation) and as such, almost no functions get marked as simple. This
patch fixes this by only registering relocations that originate outside
of the referenced function as external references.
Note that this patch causes many functions in existing RISC-V test cases
to be considered "simple" and undergo transformations. This triggered
some missing MCPlusBuilder interfaces. Therefore, this patch by itself
breaks many tests. The missing interfaces are implemented by the parents
of this patch.