This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: crash with --gc-sections


In message <20001109173339.2685.qmail@daffy.airs.com>, Ian Lance Taylor writes:
>The patch may be right, but why is the garbage collector visiting the
>*ABS* section?  I can't see any obvious reason that that should
>happen.  I generally recommend against fixing symptoms without
>understanding the underlying problem.

Here's a case that provokes it for an arm-elf target.

$ cat a.s
.section .text.foo,"ax"
.globl foo
.set foo, 0
$ cat b.c
extern void foo(void);

int _start()
{
  return foo;
}
$ arm-elf-as -o a.o a.s
$ arm-elf-gcc -c -o b.o b.c
b.c: In function `_start':
b.c:5: warning: return makes integer from pointer without a cast
$ arm-elf-objdump --reloc b.o
b.o:     file format elf32-littlearm

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
00000010 R_ARM_PC24        .text
00000018 R_ARM_ABS32       foo

$ arm-elf-ld a.o b.o --gc-sections
Segmentation fault

p.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]