This is the mail archive of the 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]
Other format: [Raw text]

Re: PATCH: The current linker failed to generate working Linux kernel

On Thu, Aug 17, 2006 at 10:50:39AM +0930, Alan Modra wrote:
> On Wed, Aug 16, 2006 at 11:26:35AM -0700, H. J. Lu wrote:
> > 	PR ld/3052
> > 	* ldlang.c (lang_size_sections_1): Don't change lma unless the
> > 	current vma overlaps the previous section.
> Not OK.  The main reason I added this code was to make using overlays
> simpler.  See
> Your patch means that all loaded sections after an overlay would again
> need to have their lma specified, which is a pain.

I don't see why I have to specify lma after overlay:

[hjl@gnu-13 overlay]$ cat foo.s
        .section .text1,"ax","progbits"
        .space 0x10
        .section .text2,"ax","progbits"
        .space 0x20
        .section .text
        .space 0x30
[hjl@gnu-13 overlay]$ cat foo.t
  OVERLAY 0x1000 : AT (0x4000)
    .text1 {*(.text1)}
    .text2 {*(.text2)}
  . = 0x2000;
  .text : { *(.text) }
  /DISCARD/ : { *(.*) }
[hjl@gnu-13 overlay]$ make foo
as   -o foo.o foo.s
./ld  -o foo -T foo.t foo.o
[hjl@gnu-13 overlay]$ readelf -l --wide foo

Elf file type is EXEC (Executable file)
Entry point 0x2000
There are 3 program headers, starting at offset 64

Program Headers:
  Type           Offset   VirtAddr           PhysAddr           FileSiz
MemSiz   Flg Align
  LOAD           0x000000 0x0000000000000000 0x0000000000000000
0x002030 0x002030 R E 0x200000
  LOAD           0x201000 0x0000000000001000 0x0000000000004000
0x000010 0x000010 R E 0x200000
  LOAD           0x401000 0x0000000000001000 0x0000000000004010
0x000020 0x000020 R E 0x200000

 Section to Segment mapping:
  Segment Sections...
   00     .text1 .text2 .text
   01     .text1
   02     .text1 .text2
[hjl@gnu-13 overlay]$


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