bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23324] Regression: R_X86_64_converted_reloc_bit left in linker o


From: zenith432 at users dot sourceforge.net
Subject: [Bug ld/23324] Regression: R_X86_64_converted_reloc_bit left in linker output with -q
Date: Tue, 26 Jun 2018 09:11:45 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23324

zenith432 at users dot sourceforge.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nickc at redhat dot com

--- Comment #2 from zenith432 at users dot sourceforge.net ---
Update:

1) This bit was being output from its inception in commit 7898495.

2) Up until commit a6fd92b, the bit was being masked by objdump and objcopy, so
the workaround was available.  Since commit a6fd92b, the bit is not longer
masked, but causes both these tools to stop with an error message.  readelf -r
can display the bit.

3) The -q option is for leaving section relocs in the object file for
post-processing tools.  Outputting this bit can break any post-processing tool
like it breaks objdump and objcopy.

       -q
       --emit-relocs
           Leave relocation sections and contents in fully linked executables.
           Post link analysis and optimization tools may need this information
           in order to perform correct modifications of executables.  This
           results in larger executables.

           This option is currently only supported on ELF platforms.

4) Please fix this for 2.31.

5) Following is a patch that fixes this

===== begin quote
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2433,6 +2433,8 @@ elf_x86_64_relocate_section (bfd *output_bfd,

       converted_reloc = (r_type & R_X86_64_converted_reloc_bit) != 0;
       r_type &= ~R_X86_64_converted_reloc_bit;
+      if (converted_reloc)
+        rel->r_info &= ~(bfd_vma) R_X86_64_converted_reloc_bit;

       if (r_type >= (int) R_X86_64_standard)
        return _bfd_unrecognized_reloc (input_bfd, input_section, r_type);
===== end quote

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]