ARGP_conserve,
ARGP_as_needed,
ARGP_no_as_needed,
+ ARGP_eh_frame_hdr,
#if YYDEBUG
ARGP_yydebug,
#endif
{ "no-as-needed", ARGP_no_as_needed, NULL, 0,
N_("Always set DT_NEEDED for following dynamic libs"), 0 },
+ { "eh-frame-hdr", ARGP_eh_frame_hdr, NULL, 0,
+ N_("Create .eh_frame_hdr section"), 0 },
+
#if YYDEBUG
{ "yydebug", ARGP_yydebug, NULL, 0,
N_("Select to get parser debug information"), 0 },
ld_state.gc_sections = key == ARGP_gc_sections;
break;
+ case ARGP_eh_frame_hdr:
+ ld_state.eh_frame_hdr = true;
+ break;
+
case 's':
if (arg == NULL)
{
#include "list.h"
+/* Header of .eh_frame_hdr section. */
+struct unw_eh_frame_hdr
+{
+ unsigned char version;
+ unsigned char eh_frame_ptr_enc;
+ unsigned char fde_count_enc;
+ unsigned char table_enc;
+};
+#define EH_FRAME_HDR_VERSION 1
+
+
/* Prototypes for local functions. */
static const char **ld_generic_lib_extensions (struct ld_state *)
__attribute__ ((__const__));
scninfo->next = queued->last->next;
queued->last = queued->last->next = scninfo;
- queued->flags = SH_FLAGS_COMBINE (queued->flags, shdr->sh_flags);
+ queued->flags = ebl_sh_flags_combine (ld_state.ebl, queued->flags,
+ shdr->sh_flags);
queued->align = MAX (queued->align, shdr->sh_addralign);
}
}
{
/* Check whether the check needs to be executable. */
if (shdr->sh_type == SHT_PROGBITS
+ && (shdr->sh_flags & SHF_EXECINSTR) == 0
&& strcmp (elf_strptr (fileinfo->elf, fileinfo->shstrndx,
shdr->sh_name),
- ".note.GNU-stack") == 0
- && (shdr->sh_flags & SHF_EXECINSTR) == 0)
+ ".note.GNU-stack") == 0)
execstack = execstack_false;
- printf("%s %d\n", elf_strptr (fileinfo->elf, fileinfo->shstrndx,
- shdr->sh_name),(int)execstack);
add_section (fileinfo, &fileinfo->scninfo[cnt]);
}
&& execstack == execstack_true
&& ld_state.execstack != execstack_false_force)
ld_state.execstack = execstack_true;
- printf("%s: state = %d\n", fileinfo->fname,(int)ld_state.execstack);
/* Handle the symbols. Record defined and undefined symbols in the
hash table. In theory there can be a file without any symbol
const char *brfname = basename (runp->fileinfo->rfname);
/* If the section isn't used, the name doesn't match the positive
- inclusion list or the name does match the negative inclusion
+ inclusion list, or the name does match the negative inclusion
list, ignore the section. */
if (!runp->used
|| (sectmask->filemask != NULL
newp->kind = scn_normal;
newp->name = osectname;
newp->type = SCNINFO_SHDR (found->shdr).sh_type;
- newp->flags = SCNINFO_SHDR (found->shdr).sh_flags;
+ /* Executable or DSO do not have section groups. Drop that
+ information. */
+ newp->flags = SCNINFO_SHDR (found->shdr).sh_flags & ~SHF_GROUP;
newp->segment_nr = segment_nr;
newp->last = found->next = found;
newp->used = true;
/* XXX Any better choice? */
queued->type = SHT_PROGBITS;
if (queued->flags != SCNINFO_SHDR (found->shdr).sh_flags)
+ /* Executable or DSO do not have section groups. Drop that
+ information. */
queued->flags = ebl_sh_flags_combine (ld_state.ebl,
queued->flags,
- SCNINFO_SHDR (found->shdr).sh_flags);
+ SCNINFO_SHDR (found->shdr).sh_flags
+ & ~SHF_GROUP);
/* Accumulate the relocation section size. */
queued->relsize += found->relsize;