<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in Makefile</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>eb81f38a - Fix objcopy for little-endian MIPS64 objects.</title>
        <link>http://172.16.0.5:8080/history/freebsd-14.2/contrib/elftoolchain/libelf/Makefile#eb81f38a</link>
        <description>Fix objcopy for little-endian MIPS64 objects.MIPS64 does not store the &apos;r_info&apos; field of a relocation table entry asa 64-bit value consisting of a 32-bit symbol index in the high 32 bitsand a 32-bit type in the low 32 bits as on other architectures.  Instead,the 64-bit &apos;r_info&apos; field is really a 32-bit symbol index followed by fourindividual byte type fields.  For big-endian MIPS64, treating this as a64-bit integer happens to be compatible with the layout expected by otherarchitectures (symbol index in upper 32-bits of resulting &quot;native&quot; 64-bitinteger).  However, for little-endian MIPS64 the parsed 64-bit integercontains the symbol index in the low 32 bits and the 4 individual bytetype fields in the upper 32-bits (but as if the upper 32-bits werebyte-swapped).To cope, add two helper routines in gelf_getrel.c to translate between thecorrect native &apos;r_info&apos; value and the value obtained after the normalbyte-swap translation.  Use these routines in gelf_getrel(), gelf_getrela(),gelf_update_rel(), and gelf_update_rela().  This fixes &apos;readelf -r&apos; onlittle-endian MIPS64 objects which was previously decoding incorrectrelocations as well as &apos;objcopy: invalid symbox index&apos; warnings fromobjcopy when extracting debug symbols from kernel modules.Even with this fixed, objcopy was still crashing when trying to extractdebug symbols from little-endian MIPS64 modules.  The workaround ingelf_*rel*() depends on the current ELF object having a valid ELF headerso that the &apos;e_machine&apos; field can be compared against EM_MIPS.  objcopywas parsing the relocation entries to possibly rewrite the &apos;r_info&apos; fieldsin the update_relocs() function before writing the initial ELF header tothe destination object file.  Move the initial write of the ELF headerearlier before copy_contents() so that update_relocs() uses the correctsymbol index values.Note that this change should really go upstream.  The binutils readelfsource has a similar hack for MIPS64EL though I implemented this versionfrom scratch using the MIPS64 ABI PDF as a reference.Discussed with:	jkoshyReviewed by:	emaste, impApproved by:	re (gjb, kib)MFC after:	1 monthDifferential Revision:	https://reviews.freebsd.org/D15734

            List of files:
            /freebsd-14.2/contrib/elftoolchain/libelf/Makefile</description>
        <pubDate>Wed, 05 Sep 2018 20:51:53 +0000</pubDate>
        <dc:creator>John Baldwin &lt;jhb@FreeBSD.org&gt;</dc:creator>
    </item>
</channel>
</rss>
