Browse Source
* emulparams/vxworks.sh (VXWORKS_BASE_EM_FILE): New variable. (EXTRA_EM_FILE): Define. * emultempl/vxworks.em: New file. * ld.texinfo (--force-dynamic): Document. * Makefile.am (eelf32ppcvxworks.cm, eelf_i386_vxworks.c): Depend on vxworks.em. * Makefile.in: Regenerate. ld/testsuite/ * ld-i386/vxworks1-static.d, ld-i386/vxworks2.s, * ld-i386/vxworks2.sd, ld-i386/vxworks2-static.sd: New tests. * ld-i386/i386.exp: Run them. * ld-powerpc/vxworks1-static.d, ld-powerpc/vxworks2.s, * ld-powerpc/vxworks2.sd, ld-powerpc/vxworks2-static.sd: New tests. * ld-powerpc/powerpc.exp: Run them.newlib-autotools-branch
17 changed files with 172 additions and 8 deletions
@ -0,0 +1,49 @@ |
|||
if test -n "$VXWORKS_BASE_EM_FILE" ; then |
|||
. "${srcdir}/emultempl/${VXWORKS_BASE_EM_FILE}.em" |
|||
fi |
|||
|
|||
cat >>e${EMULATION_NAME}.c <<EOF |
|||
|
|||
static int force_dynamic; |
|||
|
|||
static void |
|||
vxworks_after_open (void) |
|||
{ |
|||
${LDEMUL_AFTER_OPEN-gld${EMULATION_NAME}_after_open} (); |
|||
|
|||
if (force_dynamic |
|||
&& link_info.input_bfds |
|||
&& !_bfd_elf_link_create_dynamic_sections (link_info.input_bfds, |
|||
&link_info)) |
|||
einfo ("%X%P: Cannot create dynamic sections %E\n"); |
|||
|
|||
if (!force_dynamic |
|||
&& !link_info.shared |
|||
&& elf_hash_table (&link_info)->dynamic_sections_created) |
|||
einfo ("%X%P: Dynamic sections created in non-dynamic link\n"); |
|||
} |
|||
|
|||
EOF |
|||
|
|||
PARSE_AND_LIST_PROLOGUE=$PARSE_AND_LIST_PROLOGUE' |
|||
enum { |
|||
OPTION_FORCE_DYNAMIC = 501 |
|||
}; |
|||
' |
|||
|
|||
PARSE_AND_LIST_LONGOPTS=$PARSE_AND_LIST_LONGOPTS' |
|||
{"force-dynamic", no_argument, NULL, OPTION_FORCE_DYNAMIC}, |
|||
' |
|||
|
|||
PARSE_AND_LIST_OPTIONS=$PARSE_AND_LIST_OPTIONS' |
|||
fprintf (file, _("\ |
|||
--force-dynamic Always create dynamic sections\n")); |
|||
' |
|||
|
|||
PARSE_AND_LIST_ARGS_CASES=$PARSE_AND_LIST_ARGS_CASES' |
|||
case OPTION_FORCE_DYNAMIC: |
|||
force_dynamic = 1; |
|||
break; |
|||
' |
|||
|
|||
LDEMUL_AFTER_OPEN=vxworks_after_open |
|||
@ -0,0 +1,4 @@ |
|||
#name: VxWorks executable test 1 (static) |
|||
#source: vxworks1.s |
|||
#ld: tmpdir/libvxworks1.so -Tvxworks1.ld |
|||
#error: Dynamic sections created in non-dynamic link |
|||
@ -0,0 +1,9 @@ |
|||
#... |
|||
Elf file type is EXEC \(Executable file\) |
|||
Entry point 0x80000 |
|||
#... |
|||
Program Headers: |
|||
Type .* |
|||
LOAD .* 0x00080000 0x00080000 .* R E 0x1000 |
|||
|
|||
#... |
|||
@ -0,0 +1,5 @@ |
|||
.globl _start |
|||
.type _start,@function |
|||
_start: |
|||
ret |
|||
.end _start |
|||
@ -0,0 +1,13 @@ |
|||
#... |
|||
Elf file type is EXEC \(Executable file\) |
|||
Entry point 0x80400 |
|||
#... |
|||
Program Headers: |
|||
Type .* |
|||
PHDR .* |
|||
#... |
|||
LOAD .* 0x00080000 0x00080000 .* R E 0x1000 |
|||
LOAD .* 0x00081000 0x00081000 .* RW 0x1000 |
|||
DYNAMIC .* |
|||
|
|||
#... |
|||
@ -0,0 +1,4 @@ |
|||
#name: VxWorks executable test 1 (static) |
|||
#source: vxworks1.s -mregnames |
|||
#ld: tmpdir/libvxworks1.so -Tvxworks1.ld |
|||
#error: Dynamic sections created in non-dynamic link |
|||
@ -0,0 +1,9 @@ |
|||
#... |
|||
Elf file type is EXEC \(Executable file\) |
|||
Entry point 0x80000 |
|||
#... |
|||
Program Headers: |
|||
Type .* |
|||
LOAD .* 0x00080000 0x00080000 .* R E 0x10000 |
|||
|
|||
#... |
|||
@ -0,0 +1,5 @@ |
|||
.globl _start |
|||
.type _start,@function |
|||
_start: |
|||
blr |
|||
.end _start |
|||
@ -0,0 +1,13 @@ |
|||
#... |
|||
Elf file type is EXEC \(Executable file\) |
|||
Entry point 0x80400 |
|||
#... |
|||
Program Headers: |
|||
Type .* |
|||
PHDR .* |
|||
#... |
|||
LOAD .* 0x00080000 0x00080000 .* R E 0x10000 |
|||
LOAD .* 0x00090000 0x00090000 .* RW 0x10000 |
|||
DYNAMIC .* |
|||
|
|||
#... |
|||
Loading…
Reference in new issue