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

See the CrossGCC FAQ for lots more information.


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: Preventing cross-gdb/insight download of specific sections?


mkelwood@qsicorp.com wrote:

If you want to use /DISCARD/, you need an output section named /DISCARD/,
then put the input sections you want to exclude in there:
/DISCARD/ :
{
       *(.section1-to-exclude)
       *(.section2-to-exclude)
}

Looks like you are trying to stuff the output section .fpga into a memory
region named /DISCARD/. That won't do what you want.
With best regards,


Ah. Now I see. I guess I got the terminology mixed up when I read the manual. It would still seem more logical to me to specify this in terms of the memory area, but never mind that.

However, if I just replace .fpga with /DISCARD/ in the below section setup (and drop the > /DISCARD/), I get

   /usr/arm-coff/bin/ld: Illegal use of `/DISCARD/' section
   collect2: ld returned 1 exit status

Any ideas why?

MKE





The easiest way is to use objcopy to strip off the sections you don't
want.  Then download the stripped file, but load symbols from the
original.

--
Richard Sewards


-----Original Message----- From: Toralf Lund [mailto:toralf@procaptura.com] Sent: Tuesday, September 21, 2004 4:15 AM To: crossgcc Subject: Preventing cross-gdb/insight download of specific sections?

Somewhat off-topic, but...

Does anyone know how I can skip specific sections from the insight/gdb
download to my board, or alternatively, leave them out from the binary
file (without getting unresolved symbols)?

The ld manual says

  The special output section name `/DISCARD/' may be used to discard
  input sections.  Any input sections which are assigned to an output
  section named `/DISCARD/' are not included in the output file.

So I tried
.fpga :
{
  . += 1;
  . = ALIGN(64K);    /* We may assume vector section <64K */
  xc2*.o*(.data*)
  . = ALIGN(64K);    /* Let (load addr of) next section be nicely
aligned */
}  > flash AT > /DISCARD/

and also just
 } > /DISCARD/
at the last line

(.fpga is the section I wan to leave out) but got

/usr/arm-coff/bin/ld: section .fpga [00000000 -> 0002ffff] overlaps
section .dbgvect [00000000 -> 00000023]

(where .dbgvect is a section starting at address 0 which I do wand.)

Also, I tried assigning an address to /DISCARD/ (even though this
didn't

seem right), but then the linker would happily include it, and the
debugger download it.

Help, anyone?

- Toralf

------
Want more information? See the CrossGCC FAQ,
http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sources.redhat.com






------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com






------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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