Lines Matching full:elf
1 //===-- MipsELFObjectWriter.cpp - Mips ELF Writer -------------------------===//
26 #define DEBUG_TYPE "mips-elf-object-writer"
129 /// is ELF::R_MIPS_NONE.
136 if (Type == ELF::R_MIPS_HI16) in getMatchingLoType()
137 return ELF::R_MIPS_LO16; in getMatchingLoType()
138 if (Type == ELF::R_MICROMIPS_HI16) in getMatchingLoType()
139 return ELF::R_MICROMIPS_LO16; in getMatchingLoType()
140 if (Type == ELF::R_MIPS16_HI16) in getMatchingLoType()
141 return ELF::R_MIPS16_LO16; in getMatchingLoType()
143 if (Reloc.OriginalSymbol->getBinding() != ELF::STB_LOCAL) in getMatchingLoType()
144 return ELF::R_MIPS_NONE; in getMatchingLoType()
146 if (Type == ELF::R_MIPS_GOT16) in getMatchingLoType()
147 return ELF::R_MIPS_LO16; in getMatchingLoType()
148 if (Type == ELF::R_MICROMIPS_GOT16) in getMatchingLoType()
149 return ELF::R_MICROMIPS_LO16; in getMatchingLoType()
150 if (Type == ELF::R_MIPS16_GOT16) in getMatchingLoType()
151 return ELF::R_MIPS16_LO16; in getMatchingLoType()
153 return ELF::R_MIPS_NONE; in getMatchingLoType()
209 : MCELFObjectTargetWriter(_is64Bit, OSABI, ELF::EM_MIPS, in MipsELFObjectWriter()
224 return ELF::R_MIPS_NONE; in getRelocType()
227 return IsPCRel ? ELF::R_MIPS_PC16 : ELF::R_MIPS_16; in getRelocType()
230 return IsPCRel ? ELF::R_MIPS_PC32 : ELF::R_MIPS_32; in getRelocType()
237 return ELF::R_MIPS_PC16; in getRelocType()
239 return ELF::R_MICROMIPS_PC7_S1; in getRelocType()
241 return ELF::R_MICROMIPS_PC10_S1; in getRelocType()
243 return ELF::R_MICROMIPS_PC16_S1; in getRelocType()
245 return ELF::R_MICROMIPS_PC26_S1; in getRelocType()
247 return ELF::R_MICROMIPS_PC19_S2; in getRelocType()
249 return ELF::R_MICROMIPS_PC18_S3; in getRelocType()
251 return ELF::R_MICROMIPS_PC21_S1; in getRelocType()
253 return ELF::R_MIPS_PC19_S2; in getRelocType()
255 return ELF::R_MIPS_PC18_S3; in getRelocType()
257 return ELF::R_MIPS_PC21_S2; in getRelocType()
259 return ELF::R_MIPS_PC26_S2; in getRelocType()
261 return ELF::R_MIPS_PCHI16; in getRelocType()
263 return ELF::R_MIPS_PCLO16; in getRelocType()
272 return ELF::R_MIPS_64; in getRelocType()
275 unsigned Type = (unsigned)ELF::R_MIPS_NONE; in getRelocType()
276 Type = setRType((unsigned)ELF::R_MIPS_GPREL32, Type); in getRelocType()
277 Type = setRType2((unsigned)ELF::R_MIPS_64, Type); in getRelocType()
278 Type = setRType3((unsigned)ELF::R_MIPS_NONE, Type); in getRelocType()
281 return ELF::R_MIPS_GPREL32; in getRelocType()
283 return ELF::R_MIPS_GPREL16; in getRelocType()
285 return ELF::R_MIPS_26; in getRelocType()
287 return ELF::R_MIPS_CALL16; in getRelocType()
289 return ELF::R_MIPS_GOT16; in getRelocType()
291 return ELF::R_MIPS_HI16; in getRelocType()
293 return ELF::R_MIPS_LO16; in getRelocType()
295 return ELF::R_MIPS_TLS_GD; in getRelocType()
297 return ELF::R_MIPS_TLS_GOTTPREL; in getRelocType()
299 return ELF::R_MIPS_TLS_TPREL_HI16; in getRelocType()
301 return ELF::R_MIPS_TLS_TPREL_LO16; in getRelocType()
303 return ELF::R_MIPS_TLS_LDM; in getRelocType()
305 return ELF::R_MIPS_TLS_DTPREL_HI16; in getRelocType()
307 return ELF::R_MIPS_TLS_DTPREL_LO16; in getRelocType()
309 return ELF::R_MIPS_GOT_PAGE; in getRelocType()
311 return ELF::R_MIPS_GOT_OFST; in getRelocType()
313 return ELF::R_MIPS_GOT_DISP; in getRelocType()
315 unsigned Type = (unsigned)ELF::R_MIPS_NONE; in getRelocType()
316 Type = setRType((unsigned)ELF::R_MIPS_GPREL16, Type); in getRelocType()
317 Type = setRType2((unsigned)ELF::R_MIPS_SUB, Type); in getRelocType()
318 Type = setRType3((unsigned)ELF::R_MIPS_HI16, Type); in getRelocType()
322 unsigned Type = (unsigned)ELF::R_MIPS_NONE; in getRelocType()
323 Type = setRType((unsigned)ELF::R_MIPS_GPREL16, Type); in getRelocType()
324 Type = setRType2((unsigned)ELF::R_MIPS_SUB, Type); in getRelocType()
325 Type = setRType3((unsigned)ELF::R_MIPS_LO16, Type); in getRelocType()
329 return ELF::R_MIPS_HIGHER; in getRelocType()
331 return ELF::R_MIPS_HIGHEST; in getRelocType()
333 return ELF::R_MIPS_GOT_HI16; in getRelocType()
335 return ELF::R_MIPS_GOT_LO16; in getRelocType()
337 return ELF::R_MIPS_CALL_HI16; in getRelocType()
339 return ELF::R_MIPS_CALL_LO16; in getRelocType()
341 return ELF::R_MICROMIPS_26_S1; in getRelocType()
343 return ELF::R_MICROMIPS_HI16; in getRelocType()
345 return ELF::R_MICROMIPS_LO16; in getRelocType()
347 return ELF::R_MICROMIPS_GOT16; in getRelocType()
349 return ELF::R_MICROMIPS_CALL16; in getRelocType()
351 return ELF::R_MICROMIPS_GOT_DISP; in getRelocType()
353 return ELF::R_MICROMIPS_GOT_PAGE; in getRelocType()
355 return ELF::R_MICROMIPS_GOT_OFST; in getRelocType()
357 return ELF::R_MICROMIPS_TLS_GD; in getRelocType()
359 return ELF::R_MICROMIPS_TLS_LDM; in getRelocType()
361 return ELF::R_MICROMIPS_TLS_DTPREL_HI16; in getRelocType()
363 return ELF::R_MICROMIPS_TLS_DTPREL_LO16; in getRelocType()
365 return ELF::R_MICROMIPS_TLS_TPREL_HI16; in getRelocType()
367 return ELF::R_MICROMIPS_TLS_TPREL_LO16; in getRelocType()
429 return getMatchingLoType(Reloc) != ELF::R_MIPS_NONE; in sortRelocs()
436 assert(MatchingType != ELF::R_MIPS_NONE && in sortRelocs()
495 case ELF::R_MIPS_NONE: in needsRelocateWithSymbol()
505 case ELF::R_MIPS_GOT16: in needsRelocateWithSymbol()
506 case ELF::R_MIPS16_GOT16: in needsRelocateWithSymbol()
507 case ELF::R_MICROMIPS_GOT16: in needsRelocateWithSymbol()
508 case ELF::R_MIPS_HI16: in needsRelocateWithSymbol()
509 case ELF::R_MIPS16_HI16: in needsRelocateWithSymbol()
510 case ELF::R_MICROMIPS_HI16: in needsRelocateWithSymbol()
511 case ELF::R_MIPS_LO16: in needsRelocateWithSymbol()
512 case ELF::R_MIPS16_LO16: in needsRelocateWithSymbol()
513 case ELF::R_MICROMIPS_LO16: in needsRelocateWithSymbol()
517 if (cast<MCSymbolELF>(Sym).getOther() & ELF::STO_MIPS_MICROMIPS) in needsRelocateWithSymbol()
521 case ELF::R_MIPS_16: in needsRelocateWithSymbol()
522 case ELF::R_MIPS_32: in needsRelocateWithSymbol()
523 case ELF::R_MIPS_GPREL32: in needsRelocateWithSymbol()
524 if (cast<MCSymbolELF>(Sym).getOther() & ELF::STO_MIPS_MICROMIPS) in needsRelocateWithSymbol()
527 case ELF::R_MIPS_26: in needsRelocateWithSymbol()
528 case ELF::R_MIPS_64: in needsRelocateWithSymbol()
529 case ELF::R_MIPS_GPREL16: in needsRelocateWithSymbol()
530 case ELF::R_MIPS_PC16: in needsRelocateWithSymbol()
531 case ELF::R_MIPS_SUB: in needsRelocateWithSymbol()
536 case ELF::R_MIPS_REL32: in needsRelocateWithSymbol()
537 case ELF::R_MIPS_LITERAL: in needsRelocateWithSymbol()
538 case ELF::R_MIPS_CALL16: in needsRelocateWithSymbol()
539 case ELF::R_MIPS_SHIFT5: in needsRelocateWithSymbol()
540 case ELF::R_MIPS_SHIFT6: in needsRelocateWithSymbol()
541 case ELF::R_MIPS_GOT_DISP: in needsRelocateWithSymbol()
542 case ELF::R_MIPS_GOT_PAGE: in needsRelocateWithSymbol()
543 case ELF::R_MIPS_GOT_OFST: in needsRelocateWithSymbol()
544 case ELF::R_MIPS_GOT_HI16: in needsRelocateWithSymbol()
545 case ELF::R_MIPS_GOT_LO16: in needsRelocateWithSymbol()
546 case ELF::R_MIPS_INSERT_A: in needsRelocateWithSymbol()
547 case ELF::R_MIPS_INSERT_B: in needsRelocateWithSymbol()
548 case ELF::R_MIPS_DELETE: in needsRelocateWithSymbol()
549 case ELF::R_MIPS_HIGHER: in needsRelocateWithSymbol()
550 case ELF::R_MIPS_HIGHEST: in needsRelocateWithSymbol()
551 case ELF::R_MIPS_CALL_HI16: in needsRelocateWithSymbol()
552 case ELF::R_MIPS_CALL_LO16: in needsRelocateWithSymbol()
553 case ELF::R_MIPS_SCN_DISP: in needsRelocateWithSymbol()
554 case ELF::R_MIPS_REL16: in needsRelocateWithSymbol()
555 case ELF::R_MIPS_ADD_IMMEDIATE: in needsRelocateWithSymbol()
556 case ELF::R_MIPS_PJUMP: in needsRelocateWithSymbol()
557 case ELF::R_MIPS_RELGOT: in needsRelocateWithSymbol()
558 case ELF::R_MIPS_JALR: in needsRelocateWithSymbol()
559 case ELF::R_MIPS_TLS_DTPMOD32: in needsRelocateWithSymbol()
560 case ELF::R_MIPS_TLS_DTPREL32: in needsRelocateWithSymbol()
561 case ELF::R_MIPS_TLS_DTPMOD64: in needsRelocateWithSymbol()
562 case ELF::R_MIPS_TLS_DTPREL64: in needsRelocateWithSymbol()
563 case ELF::R_MIPS_TLS_GD: in needsRelocateWithSymbol()
564 case ELF::R_MIPS_TLS_LDM: in needsRelocateWithSymbol()
565 case ELF::R_MIPS_TLS_DTPREL_HI16: in needsRelocateWithSymbol()
566 case ELF::R_MIPS_TLS_DTPREL_LO16: in needsRelocateWithSymbol()
567 case ELF::R_MIPS_TLS_GOTTPREL: in needsRelocateWithSymbol()
568 case ELF::R_MIPS_TLS_TPREL32: in needsRelocateWithSymbol()
569 case ELF::R_MIPS_TLS_TPREL64: in needsRelocateWithSymbol()
570 case ELF::R_MIPS_TLS_TPREL_HI16: in needsRelocateWithSymbol()
571 case ELF::R_MIPS_TLS_TPREL_LO16: in needsRelocateWithSymbol()
572 case ELF::R_MIPS_GLOB_DAT: in needsRelocateWithSymbol()
573 case ELF::R_MIPS_PC21_S2: in needsRelocateWithSymbol()
574 case ELF::R_MIPS_PC26_S2: in needsRelocateWithSymbol()
575 case ELF::R_MIPS_PC18_S3: in needsRelocateWithSymbol()
576 case ELF::R_MIPS_PC19_S2: in needsRelocateWithSymbol()
577 case ELF::R_MIPS_PCHI16: in needsRelocateWithSymbol()
578 case ELF::R_MIPS_PCLO16: in needsRelocateWithSymbol()
579 case ELF::R_MIPS_COPY: in needsRelocateWithSymbol()
580 case ELF::R_MIPS_JUMP_SLOT: in needsRelocateWithSymbol()
581 case ELF::R_MIPS_NUM: in needsRelocateWithSymbol()
582 case ELF::R_MIPS_PC32: in needsRelocateWithSymbol()
583 case ELF::R_MIPS_EH: in needsRelocateWithSymbol()
584 case ELF::R_MICROMIPS_26_S1: in needsRelocateWithSymbol()
585 case ELF::R_MICROMIPS_GPREL16: in needsRelocateWithSymbol()
586 case ELF::R_MICROMIPS_LITERAL: in needsRelocateWithSymbol()
587 case ELF::R_MICROMIPS_PC7_S1: in needsRelocateWithSymbol()
588 case ELF::R_MICROMIPS_PC10_S1: in needsRelocateWithSymbol()
589 case ELF::R_MICROMIPS_PC16_S1: in needsRelocateWithSymbol()
590 case ELF::R_MICROMIPS_CALL16: in needsRelocateWithSymbol()
591 case ELF::R_MICROMIPS_GOT_DISP: in needsRelocateWithSymbol()
592 case ELF::R_MICROMIPS_GOT_PAGE: in needsRelocateWithSymbol()
593 case ELF::R_MICROMIPS_GOT_OFST: in needsRelocateWithSymbol()
594 case ELF::R_MICROMIPS_GOT_HI16: in needsRelocateWithSymbol()
595 case ELF::R_MICROMIPS_GOT_LO16: in needsRelocateWithSymbol()
596 case ELF::R_MICROMIPS_SUB: in needsRelocateWithSymbol()
597 case ELF::R_MICROMIPS_HIGHER: in needsRelocateWithSymbol()
598 case ELF::R_MICROMIPS_HIGHEST: in needsRelocateWithSymbol()
599 case ELF::R_MICROMIPS_CALL_HI16: in needsRelocateWithSymbol()
600 case ELF::R_MICROMIPS_CALL_LO16: in needsRelocateWithSymbol()
601 case ELF::R_MICROMIPS_SCN_DISP: in needsRelocateWithSymbol()
602 case ELF::R_MICROMIPS_JALR: in needsRelocateWithSymbol()
603 case ELF::R_MICROMIPS_HI0_LO16: in needsRelocateWithSymbol()
604 case ELF::R_MICROMIPS_TLS_GD: in needsRelocateWithSymbol()
605 case ELF::R_MICROMIPS_TLS_LDM: in needsRelocateWithSymbol()
606 case ELF::R_MICROMIPS_TLS_DTPREL_HI16: in needsRelocateWithSymbol()
607 case ELF::R_MICROMIPS_TLS_DTPREL_LO16: in needsRelocateWithSymbol()
608 case ELF::R_MICROMIPS_TLS_GOTTPREL: in needsRelocateWithSymbol()
609 case ELF::R_MICROMIPS_TLS_TPREL_HI16: in needsRelocateWithSymbol()
610 case ELF::R_MICROMIPS_TLS_TPREL_LO16: in needsRelocateWithSymbol()
611 case ELF::R_MICROMIPS_GPREL7_S2: in needsRelocateWithSymbol()
612 case ELF::R_MICROMIPS_PC23_S2: in needsRelocateWithSymbol()
613 case ELF::R_MICROMIPS_PC21_S1: in needsRelocateWithSymbol()
614 case ELF::R_MICROMIPS_PC26_S1: in needsRelocateWithSymbol()
615 case ELF::R_MICROMIPS_PC18_S3: in needsRelocateWithSymbol()
616 case ELF::R_MICROMIPS_PC19_S2: in needsRelocateWithSymbol()
621 case ELF::R_MIPS16_26: in needsRelocateWithSymbol()
622 case ELF::R_MIPS16_GPREL: in needsRelocateWithSymbol()
623 case ELF::R_MIPS16_CALL16: in needsRelocateWithSymbol()
624 case ELF::R_MIPS16_TLS_GD: in needsRelocateWithSymbol()
625 case ELF::R_MIPS16_TLS_LDM: in needsRelocateWithSymbol()
626 case ELF::R_MIPS16_TLS_DTPREL_HI16: in needsRelocateWithSymbol()
627 case ELF::R_MIPS16_TLS_DTPREL_LO16: in needsRelocateWithSymbol()
628 case ELF::R_MIPS16_TLS_GOTTPREL: in needsRelocateWithSymbol()
629 case ELF::R_MIPS16_TLS_TPREL_HI16: in needsRelocateWithSymbol()
630 case ELF::R_MIPS16_TLS_TPREL_LO16: in needsRelocateWithSymbol()