binutils 2.14.91 failed to build recent glibc for mips-linux
Atsushi Nemoto
anemo@mba.ocn.ne.jp
Wed Apr 14 12:06:00 GMT 2004
>>>>> On Wed, 14 Apr 2004 13:06:06 +0200 (CEST), "Maciej W. Rozycki" <macro@ds2.pg.gda.pl> said:
>> The _RTLD_PROLOGUE macro contains ".ent" and the _RTLD_EPILOGUE
>> macro contains ".end". So there are nested .ent/.end pairs.
macro> Perhaps there are not. Can you disclose the .s file?
OK, here is a part of .s file generated by mips-linux-gcc -S.
Definitely there are.
I'm using glibc source in Debian testing package (based on glibc
2003-09-20 CVS).
#APP
.text
.globl __start
.ent __start
.type __start, @function
__start:
.set noreorder; move $25, $31; bal 10f; nop; 10: .cpload $31; move $31, $25; .set reorder
# i386 ABI book says that the first entry of GOT holds
# the address of the dynamic structure. Though MIPS ABI
# doesn't say nothing about this, I emulate this here.
la $4, _DYNAMIC
# Subtract OFFSET_GP_GOT
sw $4, -0x7ff0($28)
move $4, $29
subu $29, 16
la $8, .Lcoff
bltzal $8, .Lcoff
.Lcoff: subu $8, $31, $8
la $25, _dl_start
addu $25, $8
jalr $25
addiu $29, 16
# Get the value of label '_dl_start_user' in t9 ($25).
la $25, _dl_start_user
.globl _dl_start_user
.type _dl_start_user,@function
.ent _dl_start_user
_dl_start_user:
.set noreorder; .cpload $25; .set reorder
move $16, $28
# Save the user entry point address in a saved register.
move $17, $2
# Store the highest stack address
sw $29, __libc_stack_end
# See if we were run as a command with the executable file
# name as an extra leading argument.
lw $2, _dl_skip_args
beq $2, $0, 1f
# Load the original argument count.
lw $4, 0($29)
# Subtract _dl_skip_args from it.
subu $4, $2
# Adjust the stack pointer to skip _dl_skip_args words.
sll $2, 2
addu $29, $2
# Save back the modified argument count.
sw $4, 0($29)
1: # Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
lw $4, _rtld_local
lw $5, 0($29)
la $6, 4($29)
sll $7, $5, 2
addu $7, $7, $6
addu $7, $7, 4
subu $29, 32
.cprestore 16
# Call the function to run the initializers.
jal _dl_init_internal
addiu $29, 32
# Pass our finalizer function to the user in $2 as per ELF ABI.
la $2, _dl_fini
# Jump to the user entry point.
move $25, $17
jr $25
.end _dl_start_user
.end __start
.size __start, . - __start
.previous
#NO_APP
---
Atsushi Nemoto
More information about the Binutils
mailing list