Closed Bug 671188 Opened 13 years ago Closed 13 years ago

elfhack throws SIGSEG with gcc/arm 4.5.2 (Ubuntu 11.04)

Categories

(Firefox Build System :: General, defect)

ARM
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla8

People

(Reporter: m_kato, Assigned: glandium)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

GCC is gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu3) (Ubuntu 11.04).  Since section is null in do_relocation_section, elfhack will crash.

/home/makoto/Development/objdir-arm/dist/bin/libxul.so: 
Program received signal SIGSEGV, Segmentation fault.
0x0804e0dc in ElfSection::getFlags() ()
(gdb) bt
#0  0x0804e0dc in ElfSection::getFlags() ()
#1  0x0805ae3c in int do_relocation_section<Elf_Rel>(Elf*, unsigned int, unsigned int) ()
#2  0x080583bd in do_file(char const*, bool) ()
#3  0x08058622 in main ()
Summary: elfhack throw SIGSEG with gcc/arm 4.5.1 → elfhack throws SIGSEG with gcc/arm 4.5.2 (Ubuntu 11.04)
Also, although libxul.so.bz2 is 117MB, can I attach it into this bug?
Oops libxul.so.bz2 is 7MB.
Please do ; or put it on some public (temporary) space.
Assignee: nobody → mh+mozilla
Your linker generates a weird relocation section... (or that could be gcc adding such relocations in some object files and ld keeping them around)
(...)
00ef439c  00000017 R_ARM_RELATIVE   
00ef43b0  00000017 R_ARM_RELATIVE   
00ef43c0  00000017 R_ARM_RELATIVE   
00ef43c4  00000017 R_ARM_RELATIVE   
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00000000  00000000 R_ARM_NONE       
00eb8700  00000011 R_ARM_TLS_DTPMOD3
00ebc904  00000011 R_ARM_TLS_DTPMOD3
00dd7400  00032b02 R_ARM_ABS32       00000000   __cxa_pure_virtual
00dd7404  00032b02 R_ARM_ABS32       00000000   __cxa_pure_virtual
00dd7408  00032b02 R_ARM_ABS32       00000000   __cxa_pure_virtual
00dd740c  00032b02 R_ARM_ABS32       00000000   __cxa_pure_virtual
(...)

Generally, there aren't empty fields like this...
Anyways, we'd better make elfhack resilient to this.
Attachment #545612 - Flags: review?(tglek) → review+
http://hg.mozilla.org/mozilla-central/rev/c41f5c1ce4f1
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
Kato-san, the relocations you get are wrong and an actual LD bug: http://sourceware.org/bugzilla/show_bug.cgi?id=13049 which will lead to a crash on startup on your build, with or without elfhack. You want to look at bug 675618 for a workaround.
Depends on: 680850
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: