Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in section list #8726

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

mhightower83
Copy link
Contributor

@mhightower83 mhightower83 commented Nov 23, 2022

For GCC LD scripts, using commas in a section expression sometimes cause problems.

With this change, .text.gdbstub* moved from IROM to IRAM where it was intended to be.
@earlephilhower please correct me or confirm. Thanks!

Resolves issue #8716

I could not find an explanation of how a "," was to be interpreted. It looks like a simple *(.somthing*, .something2*) worked; however, a more complex *(.text.something*, .text.something2*) did not - most of the time.

I don't have much experience with LD scripts. Anyone with more insight please help.

For GCC LD scripts, using commas in a section expression
sometimes cause problems.
Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html it looks like the comma should work, but it's also legal to just use spaces.

* (section)
* (section, section, ...)
* (section section ...)
    Instead of explicitly naming particular input files in a link control script, you can refer to all files from the ld command line: use `*' instead of a particular file name before the parenthesized input-file section list. If you have already explicitly included some files by name, `*' refers to all remaining files--those whose places in the output file have not yet been defined. For example, to copy sections 1 through 4 from an Oasys file into the .text section of an a.out file, and sections 13 and 14 into the .data section:

    SECTIONS {
      .text :{
        *("1" "2" "3" "4")
      }
      
      .data :{
        *("13" "14")
      }
    }

    `[ section ... ]' used to be accepted as an alternate way to specify named sections from all unallocated input files. Because some operating systems (VMS) allow brackets in file names, that notation is no longer supported. 

So, LGTM, especially since this was proven as fixing something broken!

@earlephilhower earlephilhower merged commit fe451a8 into esp8266:master Nov 23, 2022
@mhightower83 mhightower83 deleted the pr-ld-script-typo branch November 24, 2022 00:01
@mhightower83 mhightower83 restored the pr-ld-script-typo branch November 24, 2022 00:32
@mhightower83 mhightower83 deleted the pr-ld-script-typo branch November 24, 2022 00:32
@mcspr mcspr mentioned this pull request Nov 24, 2022
6 tasks
@mcspr mcspr added this to the 3.1 milestone Nov 24, 2022
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.

3 participants