Automatically enable --unique=.text for elf32-hppa.

This commit is contained in:
Alan Modra 2001-01-14 07:39:01 +00:00
parent c46b75158b
commit ffd6e9debc
2 changed files with 27 additions and 2 deletions

View file

@ -1,5 +1,11 @@
2001-01-14 Alan Modra <alan@linuxcare.com.au> 2001-01-14 Alan Modra <alan@linuxcare.com.au>
* emultempl/hppaelf.em (hppaelf_after_parse): New function,
enabling search for libmilli. On a relocatable link, make .text
sections unique.
(LDEMUL_AFTER_PARSE): Define.
(hppaelf_finish): Correct spelling of relocatable in comments.
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
rummage through the script for sections on the unique list. rummage through the script for sections on the unique list.
Correct length of strncmp for ".note". Correct length of strncmp for ".note".
@ -9,6 +15,7 @@
(unique_section_p): New function. (unique_section_p): New function.
(walk_wild_section): Don't match sections on unique_section_list. (walk_wild_section): Don't match sections on unique_section_list.
(lang_add_unique): New function. (lang_add_unique): New function.
Correct spelling of relocatable in comments.
* ldlang.h (struct unique_sections): Declare. * ldlang.h (struct unique_sections): Declare.
(unique_section_list): Declare. (unique_section_list): Declare.

View file

@ -1,5 +1,5 @@
# This shell script emits a C file. -*- C -*- # This shell script emits a C file. -*- C -*-
# Copyright (C) 1991, 93, 94, 95, 97, 99, 2000 # Copyright 1991, 93, 94, 95, 97, 99, 2000, 2001
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# #
# This file is part of GLD, the Gnu Linker. # This file is part of GLD, the Gnu Linker.
@ -27,6 +27,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#include "ldctor.h" #include "ldctor.h"
#include "elf32-hppa.h" #include "elf32-hppa.h"
static void hppaelf_after_parse PARAMS((void));
static void hppaelf_create_output_section_statements PARAMS ((void)); static void hppaelf_create_output_section_statements PARAMS ((void));
static void hppaelf_delete_padding_statements static void hppaelf_delete_padding_statements
PARAMS ((lang_statement_list_type *)); PARAMS ((lang_statement_list_type *));
@ -49,6 +50,22 @@ static int multi_subspace = 0;
should use a suitable default size. */ should use a suitable default size. */
static bfd_signed_vma group_size = 1; static bfd_signed_vma group_size = 1;
/* Stops the linker merging .text sections on a relocatable link,
and adds millicode library to the list of input files. */
static void
hppaelf_after_parse ()
{
if (link_info.relocateable)
lang_add_unique (".text");
#if 0 /* enable this once we split millicode stuff from libgcc */
else
lang_add_input_file ("milli",
lang_input_file_is_l_enum,
NULL);
#endif
}
/* This is called before the input files are opened. We create a new /* This is called before the input files are opened. We create a new
fake input file to hold the stub sections. */ fake input file to hold the stub sections. */
@ -286,7 +303,7 @@ hppaelf_layaout_sections_again ()
static void static void
hppaelf_finish () hppaelf_finish ()
{ {
/* If generating a relocateable output file, then we don't /* If generating a relocatable output file, then we don't
have to examine the relocs. */ have to examine the relocs. */
if (link_info.relocateable) if (link_info.relocateable)
return; return;
@ -399,5 +416,6 @@ PARSE_AND_LIST_ARGS_CASES='
# Put these extra hppaelf routines in ld_${EMULATION_NAME}_emulation # Put these extra hppaelf routines in ld_${EMULATION_NAME}_emulation
# #
LDEMUL_AFTER_PARSE=hppaelf_after_parse
LDEMUL_FINISH=hppaelf_finish LDEMUL_FINISH=hppaelf_finish
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=hppaelf_create_output_section_statements LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=hppaelf_create_output_section_statements