[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/11542] New: ld -r generates R_X86_64_NONE
From: |
mjw at redhat dot com |
Subject: |
[Bug ld/11542] New: ld -r generates R_X86_64_NONE |
Date: |
26 Apr 2010 20:26:08 -0000 |
This comes up when building a kernel module debuginfo. A .rela.debug_info
section contains R_X86_64_NONE relocations. It is for a symbol in a section
called .discard, which the linker script discards. It seems that ld -r should
eat the reloc rather than leave *_NONE.
Reproducer based on kernel module build:
$ cat > foo.c
int here, there __attribute__ ((section (".discard")));
$ cat > module-common.lds
/*
* Common module linker script, always used when linking a module.
* Archs are free to supply their own linker scripts. ld will
* combine them automatically.
*/
SECTIONS {
/DISCARD/ : { *(.discard) }
}
$ ld -r -o foo2.o module-common.lds foo.o ld: warning: module-common.lds
contains output sections; did you forget -T?
$ ld -r -o foo2.o -T module-common.lds foo.o
$ readelf -r foo2.o
Relocation section '.rela.debug_info' at offset 0x618 contains 11 entries:
Offset Info Type Sym. Value Sym. Name + Addend
000000000006 00040000000a R_X86_64_32 0000000000000000 .debug_abbrev + 0
00000000000c 00080000000a R_X86_64_32 0000000000000000 .debug_str + b
000000000011 00080000000a R_X86_64_32 0000000000000000 .debug_str + 38
000000000015 00080000000a R_X86_64_32 0000000000000000 .debug_str + 6
000000000019 000100000001 R_X86_64_64 0000000000000000 .text + 0
000000000021 000100000001 R_X86_64_64 0000000000000000 .text + 0
000000000029 00060000000a R_X86_64_32 0000000000000000 .debug_line + 0
00000000002e 00080000000a R_X86_64_32 0000000000000000 .debug_str + 33
00000000003b 000c00000001 R_X86_64_64 0000000000000004 here + 0
00000000004b 00080000000a R_X86_64_32 0000000000000000 .debug_str + 0
000000000058 000000000000 R_X86_64_NONE 0000000000000000
Relocation section '.rela.debug_pubnames' at offset 0x720 contains 1 entries:
Offset Info Type Sym. Value Sym. Name + Addend
000000000006 00050000000a R_X86_64_32 0000000000000000 .debug_info + 0
--
Summary: ld -r generates R_X86_64_NONE
Product: binutils
Version: 2.20
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: mjw at redhat dot com
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=11542
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/11542] New: ld -r generates R_X86_64_NONE,
mjw at redhat dot com <=