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

RESOLVED FIXED in mozilla8

Status

()

Core
Build Config
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: m_kato, Assigned: glandium)

Tracking

(Depends on: 1 bug)

Trunk
mozilla8
ARM
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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 ()
(Reporter)

Updated

6 years ago
Summary: elfhack throw SIGSEG with gcc/arm 4.5.1 → elfhack throws SIGSEG with gcc/arm 4.5.2 (Ubuntu 11.04)
(Reporter)

Comment 1

6 years ago
Also, although libxul.so.bz2 is 117MB, can I attach it into this bug?
(Reporter)

Comment 2

6 years ago
Oops libxul.so.bz2 is 7MB.
(Assignee)

Comment 3

6 years ago
Please do ; or put it on some public (temporary) space.
(Assignee)

Updated

6 years ago
Assignee: nobody → mh+mozilla
(Reporter)

Comment 4

6 years ago
libxul (arm) ... http://www.wontfix.net/temp/libxul.so.bz2
elfhack (x86) ... http://www.wontfix.net/temp/elfhack.bz2
(Assignee)

Comment 5

6 years ago
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.
(Assignee)

Comment 6

6 years ago
Created attachment 545612 [details] [diff] [review]
Don't fail on R_*_NONE relocations with an empty r_offset
Attachment #545612 - Flags: review?(tglek)

Updated

6 years ago
Attachment #545612 - Flags: review?(tglek) → review+
(Assignee)

Comment 7

6 years ago
http://hg.mozilla.org/users/mh_glandium.org/elfhack/rev/db7d8cc66096
(Assignee)

Comment 8

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/c41f5c1ce4f1
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/c41f5c1ce4f1
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
(Assignee)

Comment 10

6 years ago
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.
(Assignee)

Updated

6 years ago
Depends on: 680850
You need to log in before you can comment on or make changes to this bug.