bugGNU GRUB - Bugs: bug #47580, grub2: build for armv7a fails...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47580: grub2: build for armv7a fails with: "build-grub-module-verifier: error: unsupported relocation 0x2b."

Submitter:  Chen Qi <chenqi>
Submitted:  Thu 31 Mar 2016 02:52:17 AM UTC
   
 
Category:  Compilation Severity:  Major
Priority:  5 - Normal Item Group:  Hardware-specific
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  Git master
Release:  Reproducibility:  Every Time
Planned Release:  2.03+

Thu 31 Mar 2016 04:37:24 PM UTC, comment #2: 

Is -fPIC on gcc command line? If so it's gcc bug. A problem with this particular relocation is that AFAICT there is no way to translate them to PE relocations for arm-efi. I have their implementation for dl.c but it's no good if we can't solve PE problem

Vladimir Serbinenko <phcoder>
Group administrator
Thu 31 Mar 2016 04:28:53 PM UTC, comment #1: 

That's not enough, you need to actually implement these relocations or find compiler options to disable them. Otherwise any code that contains them will fail at run time.

Andrei Borzenkov <arvidjaar>
Group Member
Thu 31 Mar 2016 02:52:17 AM UTC, original submission:  

Building grub2 for armv7a arch would fail with the following errors.

| build-grub-module-verifier: error: unsupported relocation 0x2b.
| make[3]: * [disk.mod] Error 1
| make[3]: * Waiting for unfinished jobs....
| build-grub-module-verifier: error: unsupported relocation 0x2b.
| make[3]: * [cat.mod] Error 1
| build-grub-module-verifier: error: unsupported relocation 0x2b.
| make[3]: * [cmp.mod] Error 1

I'm using gcc 5.3 for cross compilation.
"arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm -mfpu=vfp  -mfloat-abi=softfp ...."

I've looked at the codes of grub-module-verifier. The problem seems to be that the above relocation is not allowed for 'arm' arch. Add the relocations for arm arch would solve the build failure but I really don't know whether it's appropriate.

diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c
index e217dcd..a249713 100644
--- a/util/grub-module-verifier.c
+++ b/util/grub-module-verifier.c
@@ -97,6 +97,8 @@ struct grub_module_verifier_arch archs[] = {
       R_ARM_THM_CALL,
       R_ARM_THM_JUMP24,
       R_ARM_V4BX,
+      R_ARM_MOVW_ABS_NC,
+      R_ARM_MOVT_ABS,
       R_ARM_THM_MOVW_ABS_NC,
       R_ARM_THM_MOVT_ABS,
       R_ARM_THM_JUMP19,
--
1.9.1

To summarise, is the above patch appropriate or armv7a is not yet supported?

Chen Qi <chenqi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by arvidjaar (Posted a comment)
  • -email is unavailable- added by chenqi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-05 phcoder Planned ReleaseNone 2.03+

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code