mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 13:23:10 +08:00
binutils/
* objcopy.c (copy_object): Don't setup_bfd_headers when extract_symbol. (setup_section): Don't zero vma and lma when extract_symbol. (copy_section): Discard relocations when extract_symbol. * doc/binutils.texi: Update --extract-symbol description. ld/testsuite/ * ld-elf/extract-symbol-1sec.d: Update.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2008-08-06 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* objcopy.c (copy_object): Don't setup_bfd_headers when extract_symbol.
|
||||||
|
(setup_section): Don't zero vma and lma when extract_symbol.
|
||||||
|
(copy_section): Discard relocations when extract_symbol.
|
||||||
|
* doc/binutils.texi: Update --extract-symbol description.
|
||||||
|
|
||||||
2008-08-04 Alan Modra <amodra@bigpond.net.au>
|
2008-08-04 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* Makefile.am (POTFILES.in): Set LC_ALL=C.
|
* Makefile.am (POTFILES.in): Set LC_ALL=C.
|
||||||
|
@ -1540,7 +1540,6 @@ Keep the file's section flags and symbols but remove all section data.
|
|||||||
Specifically, the option:
|
Specifically, the option:
|
||||||
|
|
||||||
@itemize
|
@itemize
|
||||||
@item sets the virtual and load addresses of every section to zero;
|
|
||||||
@item removes the contents of all sections;
|
@item removes the contents of all sections;
|
||||||
@item sets the size of every section to zero; and
|
@item sets the size of every section to zero; and
|
||||||
@item sets the file's start address to zero.
|
@item sets the file's start address to zero.
|
||||||
|
@ -1461,7 +1461,8 @@ copy_object (bfd *ibfd, bfd *obfd)
|
|||||||
any output is done. Thus, we traverse all sections multiple times. */
|
any output is done. Thus, we traverse all sections multiple times. */
|
||||||
bfd_map_over_sections (ibfd, setup_section, obfd);
|
bfd_map_over_sections (ibfd, setup_section, obfd);
|
||||||
|
|
||||||
setup_bfd_headers (ibfd, obfd);
|
if (!extract_symbol)
|
||||||
|
setup_bfd_headers (ibfd, obfd);
|
||||||
|
|
||||||
if (add_sections != NULL)
|
if (add_sections != NULL)
|
||||||
{
|
{
|
||||||
@ -2298,7 +2299,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
|||||||
else
|
else
|
||||||
vma += change_section_address;
|
vma += change_section_address;
|
||||||
|
|
||||||
if (! bfd_set_section_vma (obfd, osection, extract_symbol ? 0 : vma))
|
if (! bfd_set_section_vma (obfd, osection, vma))
|
||||||
{
|
{
|
||||||
err = _("failed to set vma");
|
err = _("failed to set vma");
|
||||||
goto loser;
|
goto loser;
|
||||||
@ -2317,7 +2318,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
|||||||
else
|
else
|
||||||
lma += change_section_address;
|
lma += change_section_address;
|
||||||
|
|
||||||
osection->lma = extract_symbol ? 0 : lma;
|
osection->lma = lma;
|
||||||
|
|
||||||
/* FIXME: This is probably not enough. If we change the LMA we
|
/* FIXME: This is probably not enough. If we change the LMA we
|
||||||
may have to recompute the header for the file as well. */
|
may have to recompute the header for the file as well. */
|
||||||
@ -2336,7 +2337,7 @@ setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
|||||||
bfd_get_section_by_name since some formats allow multiple
|
bfd_get_section_by_name since some formats allow multiple
|
||||||
sections with the same name. */
|
sections with the same name. */
|
||||||
isection->output_section = osection;
|
isection->output_section = osection;
|
||||||
isection->output_offset = extract_symbol ? vma : 0;
|
isection->output_offset = 0;
|
||||||
|
|
||||||
/* Do not copy backend data if --extract-symbol is passed; anything
|
/* Do not copy backend data if --extract-symbol is passed; anything
|
||||||
that needs to look at the section contents will fail. */
|
that needs to look at the section contents will fail. */
|
||||||
@ -2400,6 +2401,9 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
|||||||
if (size == 0 || osection == 0)
|
if (size == 0 || osection == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (extract_symbol)
|
||||||
|
return;
|
||||||
|
|
||||||
p = find_section_list (bfd_get_section_name (ibfd, isection), FALSE);
|
p = find_section_list (bfd_get_section_name (ibfd, isection), FALSE);
|
||||||
|
|
||||||
/* Core files do not need to be relocated. */
|
/* Core files do not need to be relocated. */
|
||||||
@ -2460,9 +2464,6 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg)
|
|||||||
free (relpp);
|
free (relpp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extract_symbol)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS
|
if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS
|
||||||
&& bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS)
|
&& bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS)
|
||||||
{
|
{
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2008-08-06 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* ld-elf/extract-symbol-1sec.d: Update.
|
||||||
|
|
||||||
2008-07-30 Nick Clifton <nickc@redhat.com>
|
2008-07-30 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* ld-elf/sec-to-seg.exp: New test: Checks the assignment of
|
* ld-elf/sec-to-seg.exp: New test: Checks the assignment of
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#...
|
#...
|
||||||
Sections:
|
Sections:
|
||||||
*Idx +Name +Size +VMA +LMA .*
|
*Idx +Name +Size +VMA +LMA .*
|
||||||
*0 +\.foo +0+ +0+ +0+ .*
|
*0 +\.foo +0+ +0+10000 +0+10000 .*
|
||||||
*CONTENTS, ALLOC, LOAD, CODE
|
*CONTENTS, ALLOC, LOAD, CODE
|
||||||
*1 +\.bar +0+ +0+ +0+ .*
|
*1 +\.bar +0+ +0+20000 +0+20000 .*
|
||||||
*ALLOC, READONLY, CODE
|
*ALLOC, READONLY, CODE
|
||||||
|
Reference in New Issue
Block a user