[llvm] r182092 - [PowerPC] Merge/rename PPC fixup types

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Thu May 23 15:33:35 PDT 2013


Hi David,

> Your suggestion worked to fix the addresses.
> The only diff that remains between integrated/non-integrated assembly is:
[snip]
> -000000e8       addis   r2,r2,ha16(0x188-0xd8)
> +000000e8       addis   r2,r2,ha16(0x188-0xd8+0xb00000)

Hmm.  This may be due to another change; applyFixupOffset
no longer extracts the high part because it now assumes this
was already done.  It looks like this is not true for the
FixedValue needed with Mach-O relocs ...

Can you try changing this part in RecordScatteredRelocation:

    uint32_t other_half = 0;
    switch (Type) {
    case macho::RIT_PPC_LO16_SECTDIFF:
      other_half = (FixedValue >> 16) & 0xffff;
      break;
    case macho::RIT_PPC_HA16_SECTDIFF:
      other_half = FixedValue & 0xffff;
      break;

to:

    uint32_t other_half = 0;
    switch (Type) {
    case macho::RIT_PPC_LO16_SECTDIFF:
      other_half = (FixedValue >> 16) & 0xffff;
+     FixedValue = FixedValue & 0xffff;
      break;
    case macho::RIT_PPC_HA16_SECTDIFF:
      other_half = FixedValue & 0xffff;
+     FixedValue = ((FixedValue >> 16) + ((FixedValue & 0x8000) ? 1 : 0)) &
0xffff;
      break;

> Also, have you committed your 'diff-reloc-mcexpr' patch to trunk yet? or
> plan to do so?  If it's ready, in your opinion, it would make merging
> to branch easier for me.

OK, I've checked this in as r182616 now.

Bye,
Ulrich




More information about the llvm-commits mailing list