Skip to content

Conversation

ZekeLu
Copy link
Contributor

@ZekeLu ZekeLu commented Sep 11, 2022

Changes:

  1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section
    name string table. In this case, do not try to set section names .
  2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns
    an error.

Reference:
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html

Updates #54967.

Changes:

1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section
name string table. In this case, do not try to set section names .
2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns
an error.

Reference:
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html

Note:
The reference states that: If the section name string table section index
is greater than or equal to SHN_LORESERVE (0xff00), this member has the value
SHN_XINDEX (0xffff) and the actual index of the section name string table
section is contained in the sh_link field of the section header at index 0.

This case (e_shstrndx == 0xffff) is not implemented.
@gopherbot
Copy link
Contributor

This PR (HEAD: 59eefe5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/430155 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: b7b8c37) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/430155 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Zeke Lu:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: aeb70ca) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/430155 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Zeke Lu:

Patch Set 2:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 3: Run-TryBot+1 Auto-Submit+1 Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 3: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/430155.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Sep 19, 2022
Changes:

1. When e_shstrndx holds the value SHN_UNDEF (0), the file has no section
name string table. In this case, do not try to set section names .
2. e_shstrndx should point to an SHT_STRTAB section. If it does not, returns
an error.

Reference:
https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html

Updates #54967.

Change-Id: Ic8f228061d996fd7845dfa630719a1ba12d2bb60
GitHub-Last-Rev: aeb70ca
GitHub-Pull-Request: #55001
Reviewed-on: https://go-review.googlesource.com/c/go/+/430155
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/430155 has been merged.

@gopherbot gopherbot closed this Sep 19, 2022
@ZekeLu ZekeLu deleted the elf-shstrndx branch September 21, 2022 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants