MIPs backend generates wrong reloc info for static data

Hi all,

I use llvm-clang with a MIPS target, and it seems that the backend generates wrong reloc info.
I attach a very simple test case.
* Compile test.c with 'clang -internal-as -g'
* use mips-elf-objdump -S to get the generate assembly code (see test.lst)
* use mips-elf-readelf -a to look for relocation info (see test.readelf)

All relocations for static data are 0000 ?!

I did not managed to locate the problem in the code, but I would be glad to help if someone can narrow the search area in the code base.

Thanks for you help,

test.c (175 Bytes)

test.lst (1.11 KB)

test.readelf (7.11 KB)

Hi Frédéric, I believe there have been some recent patches related to
MIPS relocations. If you have the time, could you try to reproduce
this problem with top-of-tree LLVM and clang?

Thanks,

-- Sean Silva

Could you file a PR, with the exact command (including options such as -target, etc.) to reproduce this problem?