bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/20797] New: m68k binutils produce R_68K_NONE relocations


From: slyfox at inbox dot ru
Subject: [Bug ld/20797] New: m68k binutils produce R_68K_NONE relocations
Date: Tue, 08 Nov 2016 23:53:13 +0000

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

            Bug ID: 20797
           Summary: m68k binutils produce R_68K_NONE relocations
           Product: binutils
           Version: 2.28 (HEAD)
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---

It's a long known bug without real known impact.
I have not found bugzilla entry for it thus documenting
it here. Maybe it will get fix one day.

binutils has a "FIXME" comment about it:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf32-m68k.c;h=7c2e0fcca3bfb35d71dc1431c69958c84f04de7b;hb=HEAD#l3356

3356       /* Allocate memory for the section contents.  */
3357       /* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
3358          Unused entries should be reclaimed before the section's contents
3359          are written out, but at the moment this does not happen.  Thus in
3360          order to prevent writing out garbage, we initialise the section's
3361          contents to zero.  */
3362       s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);

And glibc has a workaround to allow such relocations (but only of non-lazy
type):

https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=sysdeps/m68k/dl-machine.h;h=41c179c3f13329f61a4b16e917e4037aa4545d5e;hb=HEAD#l290

 290         case R_68K_NONE:                /* Alright, Wilbur.  */
 291           break;

How to reproduce:

$ echo 'int main(){}' > a.c
$ m68k-unknown-linux-gnu-gcc a.c -o a
$ readelf -a a | egrep 'R_68K_NONE|Relocation section'
Relocation section '.rela.dyn' at offset 0x238 contains 3 entries:
00000000  00000000 R_68K_NONE                   0
00000000  00000000 R_68K_NONE                   0
Relocation section '.rela.plt' at offset 0x25c contains 2 entries:

-- 
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]