During powerpc tests in the clang350-import branch, I noticed this -Werror warning:
libexec/rtld-elf/powerpc/reloc.c:486:6: error: taking the absolute value of unsigned type 'Elf_Addr' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value] if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^ libexec/rtld-elf/powerpc/reloc.c:486:6: note: remove the call to 'abs' since unsigned values cannot be negative if (abs(offset) < 32*1024*1024) { /* inside 32MB? */ ^~~ 1 error generated.
Just before this line, offset is calculated as the difference between two other Elf_Addr quantities, so the result may well be "negative" in the sense that it has wrapped around UINT_MAX.
So I propose to avoid using abs() altogether, and just test explicitly for the correct ranges. I replaced the decimal constants by hexadecimal ones, since that seemed a little less magical to me. Otherwise the 0xfe000000 constant can be changed to 4064*1024*1024.