* emultempl/aix.em (gld*_before_parse): Set default arch. Reverts

2002-05-10 change.
This commit is contained in:
Alan Modra
2002-08-06 11:40:30 +00:00
parent 86fff92e97
commit 7fc44b9cd6
2 changed files with 74 additions and 60 deletions

View File

@ -1,3 +1,8 @@
2002-08-06 Alan Modra <amodra@bigpond.net.au>
* emultempl/aix.em (gld*_before_parse): Set default arch. Reverts
2002-05-10 change.
2002-08-01 Nick Clifton <nickc@redhat.com> 2002-08-01 Nick Clifton <nickc@redhat.com>
* emulparams/armelf.sh: Revert previous delta. * emulparams/armelf.sh: Revert previous delta.

View File

@ -147,6 +147,15 @@ static char *command_line_blibpath = NULL;
static void static void
gld${EMULATION_NAME}_before_parse () gld${EMULATION_NAME}_before_parse ()
{ {
const bfd_arch_info_type *arch = bfd_scan_arch ("${OUTPUT_ARCH}");
if (arch)
{
ldfile_output_architecture = arch->arch;
ldfile_output_machine = arch->mach;
ldfile_output_machine_name = arch->printable_name;
}
else
ldfile_output_architecture = bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`;
config.has_shared = true; config.has_shared = true;
@ -333,9 +342,9 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
case 'T': case 'T':
/* On AIX this is the same as GNU ld -Ttext. When we see -T /* On AIX this is the same as GNU ld -Ttext. When we see -T
number, we assume the AIX option is intended. Otherwise, we number, we assume the AIX option is intended. Otherwise, we
assume the usual GNU ld -T option is intended. We can't just assume the usual GNU ld -T option is intended. We can't just
ignore the AIX option, because gcc passes it to the linker. */ ignore the AIX option, because gcc passes it to the linker. */
val = strtoull (optarg, &end, 0); val = strtoull (optarg, &end, 0);
if (*end != '\0') if (*end != '\0')
{ {
@ -459,9 +468,9 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
case OPTION_PD: case OPTION_PD:
/* This sets the page that the .data section is supposed to /* This sets the page that the .data section is supposed to
start on. The offset within the page should still be the start on. The offset within the page should still be the
offset within the file, so we need to build an appropriate offset within the file, so we need to build an appropriate
expression. */ expression. */
val = strtoull (optarg, &end, 0); val = strtoull (optarg, &end, 0);
if (*end != '\0') if (*end != '\0')
einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg); einfo ("%P: warning: ignoring invalid -pD number %s\n", optarg);
@ -483,8 +492,8 @@ gld${EMULATION_NAME}_parse_args (argc, argv)
case OPTION_PT: case OPTION_PT:
/* This set the page that the .text section is supposed to start /* This set the page that the .text section is supposed to start
on. The offset within the page should still be the offset on. The offset within the page should still be the offset
within the file. */ within the file. */
val = strtoull (optarg, &end, 0); val = strtoull (optarg, &end, 0);
if (*end != '\0') if (*end != '\0')
einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg); einfo ("%P: warning: ignoring invalid -pT number %s\n", optarg);
@ -600,8 +609,8 @@ gld${EMULATION_NAME}_after_open ()
bfd_size_type size; bfd_size_type size;
/* If the symbol is defined, we may have been invoked from /* If the symbol is defined, we may have been invoked from
collect, and the sets may already have been built, so we do collect, and the sets may already have been built, so we do
not do anything. */ not do anything. */
if (p->h->type == bfd_link_hash_defined if (p->h->type == bfd_link_hash_defined
|| p->h->type == bfd_link_hash_defweak) || p->h->type == bfd_link_hash_defweak)
continue; continue;
@ -651,9 +660,9 @@ gld${EMULATION_NAME}_before_allocation ()
lang_for_each_statement (gld${EMULATION_NAME}_find_relocs); lang_for_each_statement (gld${EMULATION_NAME}_find_relocs);
/* Precedence of LIBPATH /* Precedence of LIBPATH
-blibpath: native support always first -blibpath: native support always first
-rpath: gnu extension -rpath: gnu extension
-L build from command line -L's */ -L build from command line -L's */
if (command_line_blibpath != NULL) if (command_line_blibpath != NULL)
libpath = command_line_blibpath; libpath = command_line_blibpath;
else if (command_line.rpath != NULL) else if (command_line.rpath != NULL)
@ -704,7 +713,7 @@ gld${EMULATION_NAME}_before_allocation ()
continue; continue;
/* Remove this section from the list of the output section. /* Remove this section from the list of the output section.
This assumes we know what the script looks like. */ This assumes we know what the script looks like. */
is = NULL; is = NULL;
os = lang_output_section_find (sec->output_section->name); os = lang_output_section_find (sec->output_section->name);
if (os == NULL) if (os == NULL)
@ -1266,16 +1275,16 @@ cat >>e${EMULATION_NAME}.c <<EOF
if (link_info.relocateable == true && config.build_constructors == true) if (link_info.relocateable == true && config.build_constructors == true)
return return
EOF EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c echo ' ; else if (link_info.relocateable == true) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c echo ' ; else if (!config.magic_demand_paged) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.xn >> e${EMULATION_NAME}.c
echo ' ; else return' >> e${EMULATION_NAME}.c echo ' ; else return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c
echo '; }' >> e${EMULATION_NAME}.c echo '; }' >> e${EMULATION_NAME}.c
else else
# Scripts read from the filesystem. # Scripts read from the filesystem.