source: rtems/bsps/powerpc/motorola_powerpc/bootloader/ppcboot.lds @ 3824960

5
Last change on this file since 3824960 was 3824960, checked in by Chris Johns <chrisj@…>, on 02/24/21 at 06:04:36

powerpc/motorola_power: Link all text sections into the executable image

  • The change to building all code with code and data sections means we have a section per function. Make sure all functions are placed in the text section.

Closes #4266

  • Property mode set to 100644
File size: 2.4 KB
Line 
1OUTPUT_ARCH(powerpc)
2OUTPUT_FORMAT ("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
3/* Do we need any of these for elf?
4   __DYNAMIC = 0;    */
5SECTIONS
6{
7  .text :
8  {
9    /* We have to build the header by hand, painful since ppcboot
10        format support is very poor in binutils.
11        objdump -b ppcboot zImage --all-headers can be used to check. */
12    /* The following line can be added as a branch to use the same image
13     * for netboot as for prepboots, the only problem is that objdump
14     * did not in this case recognize the format since it insisted
15     * in checking the x86 code area held only zeroes.
16     */
17    LONG(0x48000000+start);
18    . = 0x1be; BYTE(0x80); BYTE(0)
19    BYTE(2); BYTE(0); BYTE(0x41); BYTE(1);
20    BYTE(0x12); BYTE(0x4f); LONG(0);
21    BYTE(((_edata + 0x1ff)>>9)&0xff);
22    BYTE(((_edata + 0x1ff)>>17)&0xff);
23    BYTE(((_edata + 0x1ff)>>25)&0xff);
24    . = 0x1fe;
25    BYTE(0x55);
26    BYTE(0xaa);
27    BYTE(start&0xff);
28    BYTE((start>>8)&0xff);
29    BYTE((start>>16)&0xff);
30    BYTE((start>>24)&0xff);
31    BYTE(_edata&0xff);
32    BYTE((_edata>>8)&0xff);
33    BYTE((_edata>>16)&0xff);
34    BYTE((_edata>>24)&0xff);
35    BYTE(0); /* flags */
36    BYTE(0); /* os_id */
37    BYTE(0x4C); BYTE(0x69); BYTE(0x6e);
38    BYTE(0x75); BYTE(0x78); /* Partition name */
39    . = 0x400;
40    *(.text)
41    *(.text*)
42    *(.sdata2)
43    *(.rodata)
44    *(.rodata*)
45  }
46/*  . = ALIGN(16); */
47  .image :
48  {
49    rtems.gz(*)
50    . = ALIGN(4);
51    *.gz(*)
52  }
53  /* Read-write section, merged into data segment: */
54  /* . = ALIGN(4096); */
55  .reloc   :
56  {
57    *(.got)
58    _GOT2_TABLE_ = .;
59    *(.got2)
60    _FIXUP_TABLE_ = .;
61    *(.fixup)
62    _FIXUP_END_ = .;
63  }
64
65  .handlers :
66  {
67    *(.exception)
68  }
69
70  .data    :
71  {
72    *(.data)
73    *(.data*)
74    *(.sdata)
75    . = ALIGN(4);
76    _data_end = .;
77  }
78  .bss :
79  {
80    *(.sbss)
81    *(.bss)
82    . = ALIGN(4);
83    _bss_end = .;
84  }
85  .abs 0 : {
86    __got2_entries = ABSOLUTE((_FIXUP_TABLE_ - _GOT2_TABLE_) >>2);
87    __fixup_entries = ABSOLUTE((_FIXUP_END_ - _FIXUP_TABLE_)>>2);
88    _edata = ABSOLUTE(_data_end);
89    PROVIDE(_binary_initrd_gz_start = ABSOLUTE(0));
90    PROVIDE(_binary_initrd_gz_end = ABSOLUTE(0));
91    _rtems_gz_size = ABSOLUTE(_binary_rtems_gz_end - _binary_rtems_gz_start);
92    _rtems_size = ABSOLUTE(__rtems_end - __rtems_start);
93    __bss_words = ABSOLUTE(SIZEOF(.bss)>>2);
94    __size = ABSOLUTE(_bss_end);
95  }
96
97  /DISCARD/ :
98  {
99    *(.comment)
100  }
101}
Note: See TracBrowser for help on using the repository browser.