| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /*
- * Copyright (C) 2019 Intel Corporation. All rights reserved.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
- #include "aot_reloc.h"
- #define R_MIPS_32 2 /* Direct 32 bit */
- #define R_MIPS_26 4 /* Direct 26 bit shifted */
- /* clang-format off */
- static SymbolMap target_sym_map[] = {
- REG_COMMON_SYMBOLS
- };
- /* clang-format on */
- SymbolMap *
- get_target_symbol_map(uint32 *sym_num)
- {
- *sym_num = sizeof(target_sym_map) / sizeof(SymbolMap);
- return target_sym_map;
- }
- void
- get_current_target(char *target_buf, uint32 target_buf_size)
- {
- snprintf(target_buf, target_buf_size, "mips");
- }
- static uint32
- get_plt_item_size(void)
- {
- return 0;
- }
- void
- init_plt_table(uint8 *plt)
- {
- (void)plt;
- }
- uint32
- get_plt_table_size()
- {
- return get_plt_item_size() * (sizeof(target_sym_map) / sizeof(SymbolMap));
- }
- bool
- apply_relocation(AOTModule *module, uint8 *target_section_addr,
- uint32 target_section_size, uint64 reloc_offset,
- int64 reloc_addend, uint32 reloc_type, void *symbol_addr,
- int32 symbol_index, char *error_buf, uint32 error_buf_size)
- {
- switch (reloc_type) {
- /* TODO: implement relocation for mips */
- case R_MIPS_26:
- case R_MIPS_32:
- default:
- if (error_buf != NULL)
- snprintf(error_buf, error_buf_size,
- "Load relocation section failed: "
- "invalid relocation type %d.",
- reloc_type);
- return false;
- }
- return true;
- }
|