elfxx-ia64.c question

David Mosberger davidm@napali.hpl.hp.com
Fri Jan 24 01:29:00 GMT 2003


In bfd/elfxx-ia64.c:elfNN_ia64_relocate_section() the following code
exists:

        case R_IA64_SECREL32MSB:
        case R_IA64_SECREL32LSB:
        case R_IA64_SECREL64MSB:
        case R_IA64_SECREL64LSB:
          /* Make output-section relative.  */
          if (value > input_section->output_section->vma)
            value -= input_section->output_section->vma;
          else
            value = 0;
          r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type);
          break;

Does anyone know _why_ in the world negative values would be silently
truncated to 0?  Off-hand, that seems like an incredibly stupid thing
to do (and I don't see anything in the ps-ABI that would require this).

I couldn't track down when it was added (the CVS log ends at the time
when elfxx-ia64.c was renamed from elf64-ia64.c).  I know it wasn't
there in the original versions of elf64-ia64.c, so it must have been
added for a reason.

Can anyone see a reason for this?

	--david



More information about the Binutils mailing list