Port-vax archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Anyone running -current?
The problem with -current looks like a toolchain bug, and I could use
help with some asm code...
The difference is in libc, and boils down to wether the global locale symbols
_lc_global_locale and _lc_C_locale are marked as protected or not.
This is from a failing libc.so:
Symbol table '.dynsym' contains 3636 entries:
Num: Value Size Type Bind Vis Ndx Name
1399: 000efd00 260 OBJECT GLOBAL PROTECTED 20 _lc_global_locale
1825: 000ebb7c 260 OBJECT GLOBAL PROTECTED 17 _lc_C_locale
Symbol table '.symtab' contains 3855 entries:
Num: Value Size Type Bind Vis Ndx Name
1618: 000efd00 260 OBJECT GLOBAL PROTECTED 20 _lc_global_locale
2044: 000ebb7c 260 OBJECT GLOBAL PROTECTED 17 _lc_C_locale
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
000eddc8 R_VAX_GLOB_DAT _lc_global_locale
000ede34 R_VAX_GLOB_DAT _lc_C_locale
Disassambly of isalpha:
000b2b14 <isalpha>:
b2b14: 00 00 .word 0x0000 # Entry mask: < >
b2b16: c2 04 5e subl2 $0x4,sp
b2b19: d0 ac 04 50 movl 0x4(ap),r0
b2b1d: d0 ff dd d1 movl *efd00 <_lc_global_locale>,r1
b2b21: 03 00 51
b2b24: 3c 40 a1 02 movzwl 0x2(r1)[r0],r0
b2b28: 50
b2b29: ca 8f fe ff bicl2 $0xfffffffe,r0
b2b2d: ff ff 50
b2b30: 04 ret
b2b31: 01 nop
Relocation info is:
000eddc8 00057714 R_VAX_GLOB_DAT 000efd00 _lc_global_locale + 0
I find the indirect movl *efd00 a bit strange - I would have expected a
pc relative or immediate (with relocation).
Now the working version, as expected, goes indirectly via the GOT:
Symbol table '.dynsym' contains 3636 entries:
Num: Value Size Type Bind Vis Ndx Name
1399: 000efca0 260 OBJECT GLOBAL DEFAULT 20 _lc_global_locale
1825: 000ebb1c 260 OBJECT GLOBAL DEFAULT 17 _lc_C_locale
Symbol table '.symtab' contains 3855 entries:
Num: Value Size Type Bind Vis Ndx Name
1618: 000efca0 260 OBJECT GLOBAL DEFAULT 20 _lc_global_locale
2044: 000ebb1c 260 OBJECT GLOBAL DEFAULT 17 _lc_C_locale
DYNAMIC RELOCATION RECORDS
OFFSET TYPE VALUE
000edd60 R_VAX_GLOB_DAT _lc_global_locale
000eddcc R_VAX_GLOB_DAT _lc_C_locale
Disassambly of isalpha:
000b2a9c <isalpha>:
b2a9c: 00 00 .word 0x0000 # Entry mask: < >
b2a9e: c2 04 5e subl2 $0x4,sp
b2aa1: d0 ff b9 b2 movl *edd60 <_GLOBAL_OFFSET_TABLE_+0x13bc>,r0
b2aa5: 03 00 50
b2aa8: d0 60 51 movl (r0),r1
b2aab: d0 ac 04 50 movl 0x4(ap),r0
b2aaf: 3c 40 a1 02 movzwl 0x2(r1)[r0],r0
b2ab3: 50
b2ab4: ca 8f fe ff bicl2 $0xfffffffe,r0
b2ab8: ff ff 50
b2abb: 04 ret
Can anyone explain the movl in the broken case?
Sounds to me like it dereferences the first 4 bytes of _lc_global_locale
to access _lc_global_locale, which causes a segfault.
Thanks,
Martin
Home |
Main Index |
Thread Index |
Old Index