/* Object file "section" support for the BFD library.
- Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+ 2000, 2001
Free Software Foundation, Inc.
Written by Cygnus Support.
| size 0x103 |
| output_section --------|
-
SUBSECTION
Link orders
*/
-
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
. references found to any symbol in the section. *}
.#define SEC_CLINK 0x10000000
.
+. {* Attempt to merge identical entities in the section.
+. Entity size is given in the entsize field. *}
+.#define SEC_MERGE 0x20000000
+.
+. {* If given with SEC_MERGE, entities to merge are zero terminated
+. strings where entsize specifies character size instead of fixed
+. size entries. *}
+.#define SEC_STRINGS 0x40000000
+.
. {* End of section flags. *}
.
. {* Some internal packed boolean fields. *}
. {* A mark flag used by some of the linker backends. *}
. unsigned int linker_mark : 1;
.
+. {* Another mark flag used by some of the linker backends. Set for
+. output sections that have a input section. *}
+. unsigned int linker_has_input : 1;
+.
. {* A mark flag used by some linker backends for garbage collection. *}
. unsigned int gc_mark : 1;
.
.
. unsigned int lineno_count;
.
+. {* Entity size for merging purposes. *}
+.
+. unsigned int entsize;
+.
. {* Optional information about a COMDAT entry; NULL if not COMDAT. *}
.
. struct bfd_comdat_info *comdat;
/* name, id, index, next, flags, user_set_vma, reloc_done, */ \
{ NAME, IDX, 0, NULL, FLAGS, 0, 0, \
\
- /* linker_mark, gc_mark, segment_mark, vma, lma, _cooked_size, */ \
- 0, 0, 0, 0, 0, 0, \
+ /* linker_mark, linker_has_input, gc_mark, segment_mark, */ \
+ 0, 0, 1, 0, \
+ \
+ /* vma, lma, _cooked_size, _raw_size, */ \
+ 0, 0, 0, 0, \
\
- /* _raw_size, output_offset, output_section, alignment_power, */ \
- 0, 0, (struct sec *) &SEC, 0, \
+ /* output_offset, output_section, alignment_power, */ \
+ 0, (struct sec *) &SEC, 0, \
\
/* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \
NULL, NULL, 0, 0, 0, \
/* line_filepos, userdata, contents, lineno, lineno_count, */ \
0, NULL, NULL, NULL, 0, \
\
- /* comdat, kept_section, moving_line_filepos, target_index, */ \
- NULL, NULL, 0, 0, \
+ /* entsize, comdat, kept_section, moving_line_filepos, */ \
+ 0, NULL, NULL, 0, \
\
- /* used_by_bfd, constructor_chain, owner, */ \
- NULL, NULL, NULL, \
+ /* target_index, used_by_bfd, constructor_chain, owner, */ \
+ 0, NULL, NULL, NULL, \
\
/* symbol, */ \
(struct symbol_cache_entry *) &global_syms[IDX], \
return NULL;
}
-
/*
FUNCTION
bfd_get_unique_section_name
return sname;
}
-
/*
FUNCTION
bfd_make_section_old_way
*/
-
asection *
bfd_make_section_old_way (abfd, name)
bfd *abfd;
return bfd_make_section_anyway (abfd, name);
}
-
/*
FUNCTION
bfd_set_section_flags
return true;
}
-
/*
FUNCTION
bfd_map_over_sections
SYNOPSIS
void bfd_map_over_sections(bfd *abfd,
- void (*func)(bfd *abfd,
+ void (*func) (bfd *abfd,
asection *sect,
PTR obj),
PTR obj);
| for (p = abfd->sections; p != NULL; p = p->next)
| func(abfd, p, ...)
-
*/
/*VARARGS2*/
abort ();
}
-
/*
FUNCTION
bfd_set_section_size
bfd_size_type val;
{
/* Once you've started writing to any section you cannot create or change
- the size of any others. */
+ the size of any others. */
if (abfd->output_has_begun)
{
file_ptr offset,
bfd_size_type count);
-
DESCRIPTION
Sets the contents of the section @var{section} in BFD
@var{abfd} to the data starting in memory at @var{data}. The
data is written to the output section starting at offset
@var{offset} for @var{count} octets.
-
-
Normally <<true>> is returned, else <<false>>. Possible error
returns are:
o <<bfd_error_no_contents>> -
This routine is front end to the back end function
<<_bfd_set_section_contents>>.
-
*/
#define bfd_get_section_size_now(abfd,sec) \
break;
}
+ /* Record a copy of the data in memory if desired. */
+ if (section->contents
+ && location != section->contents + offset)
+ memcpy (section->contents + offset, location, count);
+
if (BFD_SEND (abfd, _bfd_set_section_contents,
(abfd, section, location, offset, count)))
{
with zeroes. If no errors occur, <<true>> is returned, else
<<false>>.
-
-
*/
boolean
bfd_get_section_contents (abfd, section, location, offset, count)