Menu

#593 gelf_getsymshndx errors when second parameter is NULL

RELEASE_1_0
closed
None
2021-02-06
2020-08-01
No

elfutils gelf_getsymshndx does not error when the second parameter is non-NULL, and as of linux kernel 5.8, this seems to be a way that function is used. elfutils has this comment: "The user is not required to pass a data descriptor for an extended section index table." which I think is about not requiring the second parameter to be non-NULL, would it be possible for gelf_getsymshndx to be changed to support that behaviour, so that elftoolchain's libelf can continue to be used to build the kernel?

Discussion

  • Ethan Sommer

    Ethan Sommer - 2020-08-03

    I have attached a patch that I believe resolves this issue, and only retrieves the extended section index when the 2nd parameter is non-NULL.

     
  • Joseph Koshy

    Joseph Koshy - 2020-08-04
    • status: new --> accepted
    • assigned_to: Joseph Koshy
     
  • Ethan Sommer

    Ethan Sommer - 2020-09-22

    ping?

     
  • Michael Forney

    Michael Forney - 2020-09-23

    FWIW, I also ran into this issue and Ethan's patch looks good to me. I just made a slight tweak to remove the impossible lid == NULL check in the subsequent if statement.

    I attached my patch variation.

     
  • Joseph Koshy

    Joseph Koshy - 2020-09-23

    I'll be taking this up shortly.

    The manual needs to be changed along with this code change.

    The libelf test suite doesn't have tests for gelf_getsymshndx() currently. I'll need to add those later.

     
  • Joseph Koshy

    Joseph Koshy - 2020-09-26

    Fixed in [r3873].

     

    Related

    Commit: [r3873]

  • Joseph Koshy

    Joseph Koshy - 2020-09-26

    Could you please confirm that the fix works for you?

     
  • Joseph Koshy

    Joseph Koshy - 2021-02-06
    • status: accepted --> closed
     

Log in to post a comment.